Answers for "take unique values from column and store in 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
-1

get unique values from a list

mylist = ['nowplaying', 'PBS', 'PBS', 'nowplaying', 'job', 'debate', 'thenandnow']
myset = set(mylist)
print(myset)
mynewlist = list(myset)
#['nowplaying', 'PBS', 'job', 'debate', 'thenandnow']
Posted by: Guest on January-06-2022

Code answers related to "take unique values from column and store in list"

Python Answers by Framework

Browse Popular Code Answers by Language