Tengo una lista que cuenta valores, uno de los valores que obtuve es 'nan'
countries= [nan, 'USA', 'UK', 'France']
Traté de eliminarlo, pero cada vez aparece un error
cleanedList = [x for x in countries if (math.isnan(x) == True)]
TypeError: a float is required
Cuando probé este:
cleanedList = cities[np.logical_not(np.isnan(countries))]
cleanedList = cities[~np.isnan(countries)]
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
"nan", no un valor real de NaN.