0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【メモ】Pandas の read_csv でパースエラーが出たとき

Last updated at Posted at 2019-04-01

問題

このようなエラーが出て、入力CSVファイルに問題が無いように見えて困っていた。

Error tokenizing data. C error: EOF inside string starting at line

#解決
下記に書いてあるとおり、engine='python' を指定するとエラーが起きなくなった。

Pandas CSV error: Error tokenizing data. C error: EOF inside string starting at line

根本的にはCSV側の問題を特定すべきだが、c engine でエラーが出ていても python engine だと回避してくれる事があるのは短期的な補修には役立つ知識だと思われる。

欠点は速度が低下すること。長大なファイルの取り扱い時には差が出てくる可能性大。

0
4
2

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
0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?