-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: default value for dtype_backend is not applied by default #58938
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
Thanks for the report. I'd guess that this is the intention as integers with NA values cannot be stored in a NumPy array (they would be coerced to float or object). If that is the case, the docstring could be improved to include this (or a more generic description of it). This was originally added in #50505; @phofl - was this case considered? |
the doc string is incorrect, sorry about this the behaviour is correct |
take |
It is observed that the resulting data type is not solely dependent on the presence of ser2 = pd.Series(['150.0', '2'])
print(pd.to_numeric(ser2, dtype_backend='numpy_nullable'))
print(pd.to_numeric(ser2, dtype_backend='pyarrow'))
print(pd.to_numeric(ser2))
# 0 150.0
# 1 2.0
# dtype: Float64
# 0 150.0
# 1 2.0
# dtype: double[pyarrow]
# 0 150.0
# 1 2.0
# dtype: float64 The default pandas/pandas/core/tools/numeric.py Line 46 in 566e592
pandas/pandas/core/tools/numeric.py Lines 213 to 220 in 566e592
|
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Installed Versions
The text was updated successfully, but these errors were encountered: