I have a list that countain values, one of the values I got is \'nan\'
countries= [nan, \'USA\', \'UK\', \'France\']
I tried to remove it,
I noticed that Pandas for example will return 'nan' for blank values. Since it's not a string you need to convert it to one in order to match it. For example:
ulist = df.column1.unique() #create a list from a column with Pandas which
for loc in ulist:
loc = str(loc) #here 'nan' is converted to a string to compare with if
if loc != 'nan':
print(loc)