Answers for "how to return unique values in a list in python"

1

pandas unique values to list

df.groupby('param')['column'].nunique().sort_values(ascending=False).unique().tolist()
Posted by: Guest on May-15-2020
-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 "how to return unique values in a list in python"

Python Answers by Framework

Browse Popular Code Answers by Language