reshape()関数についての派手なマニュアルでは、 >>> a = np.zeros((10, 2)) # A transpose make the array non-contiguous >>> b = a.T # Taking a view makes it possible to modify the shape without modifying the # initial object. >>> c = b.view() >>> c.shape = (20) AttributeError: incompatible shape for a non-contiguous array 私の質問は: …
カウント値のリストがあります。取得した値の1つは「nan」です。 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 …