-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: include defaults into docs for true_values and false_values #48597
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
Conversation
I don't think a whatsnew entry or anything else is needed for a doc-only PR, but please tell me if I've missed anything. |
There are a bunch of errors, but it doesn't look like they have anything to do with the docstring change, and they seem to be cropping up over all the current PRs. |
@@ -195,9 +195,9 @@ | |||
Dict of functions for converting values in certain columns. Keys can either | |||
be integers or column labels. | |||
true_values : list, optional | |||
Values to consider as True. | |||
Values to consider as True in addition to case-insensitive variants of "True". |
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.
Do you know if there are tests for case-insensitive variants of True/False
?
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.
That's a great question, it will tell us whether the case insensitivity is intended or unnoticed behavior. I'll take a look today or tomorrow.
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.
@mroeschke I've taken a look, and the closest that I can find is test_boolean_dtype
here. There are also some conversion tests in test_na_values.py
. But those have a different purpose.
What would your suggestion be?
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.
Thanks for checking. I think test_boolean_dtype
should cover the additional docstring note you added here.
Thanks @AlexKirko |
Motivation
This PR touches only one docstring, so no other checks are necessary. As outlined in #48487, when we call
pd.read_csv
, we eventually go to_libs/ops.pyx
, where there are defaults fortrue_values
andfalse_values
:In addition, there appears to be a
str.lower()
orstr.upper()
call somewhere, although I can't find it, becausetrUe
is treated as true-like too. We should outline this in the docstring, so that it's not a surprise to our users.Definition of done
true_values
andfalse_values
in the docstring forpd.read_csv