Answers for "mapping numbers to unique values in a list"

3

get list of unique values in pandas column

a = df['column name'].unique() #returns a list of unique values
Posted by: Guest on March-29-2021
3

how to find unique values in list in python

mylist = ['nowplaying', 'PBS', 'PBS', 'nowplaying', 'job', 'debate', 'thenandnow']
myset = set(mylist)
print(myset)
Posted by: Guest on February-25-2021
-1

Create list of unique values from dictionary

dict = {'511':'Vishnu','512':'Vishnu','513':'Ram','514':'Ram','515':'sita'}
list =[] # create empty list
for val in dict.values(): 
  if val in list: 
    continue 
  else:
    list.append(val)

print list
Posted by: Guest on August-20-2021

Code answers related to "mapping numbers to unique values in a list"

Python Answers by Framework

Browse Popular Code Answers by Language