मेरे पास एक सूची है जो मूल्यों को गिनती है, जो एक मूल्य मुझे मिला है वह 'नैन' है
countries= [nan, 'USA', 'UK', 'France']
मैंने इसे हटाने की कोशिश की, लेकिन मुझे हर बार एक त्रुटि मिलती है
cleanedList = [x for x in countries if (math.isnan(x) == True)]
TypeError: a float is required
जब मैंने यह कोशिश की:
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", वास्तविक NaN मान नहीं।