-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
BUG, DOC: Fix inconsistencies with scalar na_values in read_csv #14056
Conversation
2cee6d5
to
f660682
Compare
pls update io/excel as well as I believe uses same code |
f660682
to
d867313
Compare
@jreback : Good point. Fixed. |
Current coverage is 85.27% (diff: 100%)@@ 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
|
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)) + """'. |
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. Done.
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.
d867313
to
7f253f2
Compare
Thanks! |
na_values
na_values
Closes #12224.