LoginSignup
3
0

3.pandas 2.0以降のエラーについて

Posted at

3.pandas 2.0以降のエラーについて

pandas1.5.3まで使用可能だった一部のメソッドについて、pandas 2.0以降では廃止(エラー)になるため、下記にまとめます。

・目次
3.1.警告機能
3.2.廃止機能
 3.2.1.appendメソッド



3.2.廃止機能
append():以下発生
 AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?

pandas 2.0で廃止された機能(2023/4/3 リリース)
 ※2023/12/8時点最新はpandas 2.1.3 (2023/11/10 リリース)

対策:

Python.
 df = df.append(pd.Series(data), ignore_index=True)

Python.
 df = pd.concat([df, pd.DataFrame([data])], ignore_index=True)



以上!

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0