how to remove nan from a list in python code example
Example 1: remove nan from list python
cleanedList = [x for x in countries if str(x) != 'nan']
Example 2: how to delete nan values in python
x = x[~numpy.isnan(x)]
cleanedList = [x for x in countries if str(x) != 'nan']
x = x[~numpy.isnan(x)]