Skip to content

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

Merged
merged 4 commits into from
Jun 22, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pandas/core/tools/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Copy link
Member

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
-----------
...

Copy link
Contributor Author

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


.. versionadded:: 0.19.0

Returns
Expand Down