Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API/ENH: easier configurable NA values for parsing #19156

Closed
chris-b1 opened this issue Jan 9, 2018 · 1 comment
Closed

API/ENH: easier configurable NA values for parsing #19156

chris-b1 opened this issue Jan 9, 2018 · 1 comment
Labels
Enhancement IO CSV read_csv, to_csv

Comments

@chris-b1
Copy link
Contributor

chris-b1 commented Jan 9, 2018

xref #16079 (adding lowercase n/a to default missing values) - I have a case where I want to treat 'n/a' as non-missing, but keep the rest of the default behavior. It seems this is about the best I can do, which involves an internal value.

from io import StringIO
data = '''a,b
1,2
3,n/a'''
pd.read_csv(StringIO(data), 
    na_values=pd.io.common._NA_VALUES.difference(['n/a']), 
    keep_default_na=False)

Not suggesting reverting #16079, but wonder if if there might be a better way to expose through some kind of option? Initial idea was something like pd.options.na_values (set to the current _NA_VALUES), though might be issues using a mutable value as an option. Also could expose something like pd.io.DEFAULT_NA_VALUES

@chris-b1 chris-b1 added IO Data IO issues that don't fit into a more specific label API Design IO CSV read_csv, to_csv labels Jan 9, 2018
@mroeschke mroeschke removed API Design IO Data IO issues that don't fit into a more specific label labels Jun 12, 2021
@mroeschke
Copy link
Member

Seems like this hasn't gotten traction in a while so closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO CSV read_csv, to_csv
Projects
None yet
Development

No branches or pull requests

2 participants