আমার কাছে একটি তালিকা রয়েছে যা মানকে গণনা করে, আমি যে মানগুলি পেয়েছি তার মধ্যে একটি হল 'ন্যান'
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", প্রকৃত এনএএন মান নয়।