-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
pd.to_numeric(..., errors="coerce") failing silently when strings contain "uint64" #32394
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
pd.to_numeric(..., errors="coerce")
failing silently when strings contain "uint64"
A bit simpler reproducer: In [9]: b = np.array(['uint64'], dtype=object)
In [10]: pd._libs.lib.maybe_convert_numeric(b, set(), coerce_numeric=True) We explicitly check for uint64 in the error message at Line 2029 in f25ed6f
It'd be great if you could do more investigation here. |
take |
This seems to be a relic of really old type inference mechanics which were present in pandas/src/inference.pyx (commit 17d7ddb by gfyoung). |
reopening as going to revert this - |
Problem description
When trying to coerce strings to numeric values using
to_numeric()
, the occurrence of the substring "uint64" (but not any other dtype-like substring it seems) leads to silent failure to coerce.Expected Output
Seems to fail equally in 0.25.3 and 1.0...
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
pandas : 0.25.3
numpy : 1.17.3
pytz : 2019.3
dateutil : 2.8.1
pip : 20.0.2
setuptools : 45.1.0.post20200119
Cython : None
pytest : 5.3.4
hypothesis : None
sphinx : 2.3.1
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.4.1
html5lib : None
pymysql : 0.9.3
psycopg2 : 2.8.4 (dt dec pq3 ext lo64)
jinja2 : 2.10.3
IPython : 7.11.1
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : 4.4.1
matplotlib : 3.1.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.14.1
pytables : None
s3fs : None
scipy : 1.4.1
sqlalchemy : 1.3.12
tables : None
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: