Pandasにてcsvのデータを処理したいのですが、空白の場合NaNが変数にはいるようで、
下記のように空白の場合の判定をしようとしたところ文字列が入力されている場合はエラーがでてしまいます。
他に空白を判定するために良い方法はあるのでしょうか。
for index, row in df.iterrows(): email = row['email'] if np.isnan(email): print(email)
■ isnanのエラー内容
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''
回答2件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。
2021/01/27 06:48
2021/01/27 06:51