Skip to content

BUG, DOC: Fix inconsistencies with scalar na_values in read_csv #14056

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

Merged

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Aug 21, 2016

  1. Update documentation to state that scalars are accepted for na_values
  2. Accept scalars for the values when a dictionary is passed in for na_values

Closes #12224.

@gfyoung gfyoung force-pushed the single-elt-dict-na branch from 2cee6d5 to f660682 Compare August 21, 2016 02:58
@jreback
Copy link
Contributor

jreback commented Aug 21, 2016

pls update io/excel as well as I believe uses same code

@gfyoung gfyoung force-pushed the single-elt-dict-na branch from f660682 to d867313 Compare August 21, 2016 03:34
@gfyoung
Copy link
Member Author

gfyoung commented Aug 21, 2016

@jreback : Good point. Fixed.

@codecov-io
Copy link

codecov-io commented Aug 21, 2016

Current coverage is 85.27% (diff: 100%)

Merging #14056 into master will increase coverage by <.01%

@@             master     #14056   diff @@
==========================================
  Files           139        139          
  Lines         50440      50442     +2   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43012      43015     +3   
+ Misses         7428       7427     -1   
  Partials          0          0          

Powered by Codecov. Last update ae4ffac...7f253f2

na_values : scalar, str, list-like, or dict, default None
Additional strings to recognize as NA/NaN. If dict passed, specific
per-column NA values. By default the following values are interpreted
as NaN: '""" + "', '".join(sorted(_NA_VALUES)) + """'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the join here? Concatenating docstrings does not work like this (as I experienced when reviewing the other PR which added this).

And I don't think it is worth it for TextParser (not a very public class) to separate the docstring like is done for read_csv)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Done.

@jorisvandenbossche jorisvandenbossche added this to the 0.19.0 milestone Aug 21, 2016
Update documentation to state that scalars are accepted for
na_values. In addition, accept scalars for the values when a
dictionary is passed in for na_values.

Closes pandas-devgh-12224.
@gfyoung gfyoung force-pushed the single-elt-dict-na branch from d867313 to 7f253f2 Compare August 21, 2016 16:22
@jorisvandenbossche jorisvandenbossche merged commit 447df80 into pandas-dev:master Aug 21, 2016
@jorisvandenbossche
Copy link
Member

Thanks!

@gfyoung gfyoung deleted the single-elt-dict-na branch August 21, 2016 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Docs IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants