-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: pandas.read_csv #48487
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
Comments
Confirmed. Looks like Should we just add to the docs that the default values for |
I think that's a good start. I guess I'd like a definitive list, I tried to trace the source code but got to a .so and went no further. There could be more than just true and false that are treated this way for all we know. I also think the second part of my request is important, documenting how to prevent this behavior |
Weird that you got stuck on |
Not sure if this is right, but I was looking here. Which eventually calls this where I see |
Got it. The code you were looking for is in # the defaults
true_vals = {'True', 'TRUE', 'true'}
false_vals = {'False', 'FALSE', 'false'}
if true_values is not None:
true_vals = true_vals | set(true_values)
if false_values is not None:
false_vals = false_vals | set(false_values) |
My experiments also show that any case variant, such as @ryanbaekr , would you like to make a PR with the Docs modification? |
No worries, I'll do it then. |
Pandas version checks
main
hereLocation of the documentation
https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html
Documentation problem
There are certain values that read_csv interprets as booleans even if the true_values and false_values parameters are set to none or an empty list. In my opinion, there are two oversights with the documentation here.
Suggested fix for documentation
The text was updated successfully, but these errors were encountered: