Python
1def main(): 2 with codecs.open("to_watcher.csv", "r", "utf-8", "ignore") as file: 3 df = pd.read_table(file, delimiter=",") 4 5 6 wordlist = [] 7 for i in range(df.shape[0]): 8 t = df.loc[i, 'text'] 9 10 print(i) 11 12 # Noneの場合処理をとばす 13 if t == None: 14 continue 15 elif np.isnan(t): 16 continue 17 18 wordlist.append(t)
以上のようなコードで、
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''
このようなエラーが出ます・
何が原因でしょうか。
よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。