filter out nan from list python code example
Example 1: remove nan from list python
cleanedList = [x for x in countries if str(x) != 'nan']
Example 2: Remove nan from list python
df.dropna(subset = ["column2"], inplace=True)
cleanedList = [x for x in countries if str(x) != 'nan']
df.dropna(subset = ["column2"], inplace=True)