import numpy as np
def unique(list1):
npArray1 = np.array(list1)
uniqueNpArray1 = np.unique(npArray1)
return uniqueNpArray.tolist()
list1 = [10, 20, 10, 30, 40, 40]
unique(list1) # [10, 20, 30, 40]
df.groupby('param')['column'].nunique().sort_values(ascending=False).unique().tolist()
mylist = ['nowplaying', 'PBS', 'PBS', 'nowplaying', 'job', 'debate', 'thenandnow']
myset = set(mylist)
print(myset)
mylist = ['nowplaying', 'PBS', 'PBS', 'nowplaying', 'job', 'debate', 'thenandnow']
myset = set(mylist)
print(myset)
mynewlist = list(myset)
#['nowplaying', 'PBS', 'job', 'debate', 'thenandnow']
# just turn it into a set and then convert again into a list
res = list(set(lst1)))
# now check the lengths of the two lists
print(len(res))
print(len(lst1))
len(set(["word1", "word1", "word2", "word3"]))
# set is like a list but it removes duplicates
# len counts the number of things inside the set
list(dict.fromkeys(list_with_duplicates))