Pandas: Add option to disable empty string -> NA in file readers

Created on 12 Jun 2012  路  5Comments  路  Source: pandas-dev/pandas

Most helpful comment

Why was this issue closed? This behavior hasn't changed yet.
Why not have it read empty cells as None instead?
My problem with NaN is that it returns True when cast to boolean.
Is there a good reason for this?

Btw, sorry to necrobump this over four years later

Edit: just realized that if you specify keep_default_na=False it reads empty cells as empty strings!

All 5 comments

We should document this somewhere?

added a small note

Why was this issue closed? This behavior hasn't changed yet.
Why not have it read empty cells as None instead?
My problem with NaN is that it returns True when cast to boolean.
Is there a good reason for this?

Btw, sorry to necrobump this over four years later

Edit: just realized that if you specify keep_default_na=False it reads empty cells as empty strings!

Thanks for the tip, @cauebs! The way that na_values and keep_default_na work is explained in more detail at:
More consistent na_values handling in read_csv 路 Issue #1657

Was this page helpful?
0 / 5 - 0 ratings