Eu tenho uma lista que contém valores, um dos valores que recebi é 'nan'
countries= [nan, 'USA', 'UK', 'France']
Eu tentei removê-lo, mas sempre recebo um erro
cleanedList = [x for x in countries if (math.isnan(x) == True)]
TypeError: a float is required
Quando eu tentei 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", não com um valor NaN real.