Ho una lista di valori di montagna, uno dei valori che ho ricevuto è 'nan'
countries= [nan, 'USA', 'UK', 'France']
Ho provato a rimuoverlo, ma ogni volta ricevo un errore
cleanedList = [x for x in countries if (math.isnan(x) == True)]
TypeError: a float is required
Quando ho provato questo:
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", non un valore NaN effettivo.