Değerleri sayan bir listem var, aldığım değerlerden biri 'nan'
countries= [nan, 'USA', 'UK', 'France']
Kaldırmaya çalıştım ama her seferinde bir hata alıyorum
cleanedList = [x for x in countries if (math.isnan(x) == True)]
TypeError: a float is required
Bunu denediğimde:
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", gerçek bir NaN değerine değil , dizeye benziyor .