We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://pandas.pydata.org/docs/dev/reference/api/pandas.to_numeric.html?highlight=to_numeric#pandas.to_numeric
The documentation declares that the downcast argument of pd.to_numeric can use the value int. However, only integer is working in the real code:
downcast
pd.to_numeric
int
integer
In [8]: pd.to_numeric(["42"], downcast="int", errors="coerce") --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-8-3b178e77dcd5> in <module> ----> 1 pd.to_numeric(["42"], downcast="int", errors="coerce") /usr/lib/python3.8/site-packages/pandas/core/tools/numeric.py in to_numeric(arg, errors, downcast) 110 """ 111 if downcast not in (None, "integer", "signed", "unsigned", "float"): --> 112 raise ValueError("invalid downcasting method provided") 113 114 if errors not in ("ignore", "raise", "coerce"): ValueError: invalid downcasting method provided In [9]: pd.to_numeric(["42"], downcast="integer", errors="coerce") Out[9]: array([42], dtype=int8)
Replace int with integer
The text was updated successfully, but these errors were encountered:
Thanks @languitar for the report.
It appears that the docs were incorrectly updated in #33093 (and that there are other docstrings that may also now be incorrect)
further investigation and PRs welcome
Sorry, something went wrong.
I am new to contribution, I wanted to know if this issue is still open to work on?
Thanks @Anupam-USP.
I wanted to know if this issue is still open to work on?
There is currently a PR open to address this issue. #35776
I am new to contribution
you may want to look through the good first issues that need tests added to prevent regressions
https://github.com/pandas-dev/pandas/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22Needs+Tests%22
or for documentation related good first issues
https://github.com/pandas-dev/pandas/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3ADocs
Successfully merging a pull request may close this issue.
Location of the documentation
https://pandas.pydata.org/docs/dev/reference/api/pandas.to_numeric.html?highlight=to_numeric#pandas.to_numeric
Documentation problem
The documentation declares that the
downcast
argument ofpd.to_numeric
can use the valueint
. However, onlyinteger
is working in the real code:Suggested fix for documentation
Replace
int
withinteger
The text was updated successfully, but these errors were encountered: