-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Adding clarification on return dtype of to_numeric #21585
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
Specifying the default return types for `to_numeric` in case of no downcast
Codecov Report
@@ Coverage Diff @@
## master #21585 +/- ##
==========================================
+ Coverage 91.9% 91.9% +<.01%
==========================================
Files 153 153
Lines 49549 49549
==========================================
+ Hits 45537 45539 +2
+ Misses 4012 4010 -2
Continue to review full report at Codecov.
|
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 the PR!
pandas/core/tools/numeric.py
Outdated
@@ -43,6 +43,10 @@ def to_numeric(arg, errors='raise', downcast=None): | |||
checked satisfy that specification, no downcasting will be | |||
performed on the data. | |||
|
|||
Also Note that the default return dtype is `float64` or `int64` | |||
depending on the data supplied.`downcast` for `float` or `int` | |||
should only be used if output desired is `float32` or `int32` |
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.
I would maybe add something like this to the "extended summary" (just after the first line of the docstring), so something like:
Convert argument to a numeric type.
The default return dtype is `float64` or `int64` depending on the data supplied.
Use the `downcast` parameter to obtain other dtypes.
Parameters
-----------
...
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.
@jorisvandenbossche Sure, I will modify the PR asap
Adding the explanation in extended summary
Hello @uds5501! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on June 22, 2018 at 10:05 Hours UTC |
thanks! |
Specifying the default return types for
to_numeric
in case of no downcastgit diff upstream/master -u -- "*.py" | flake8 --diff