-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG: Calling to_datetime With errrors="coerce" Still Raises After 50 Rows #45319
Comments
I'm also running into this error with Pandas 1.4.0. Some example code is below.
INSTALLED VERSIONScommit : bb1f651 pandas : 1.4.0 |
Confirming that this is still an issue on 1.4.1. |
@jeremytwfortune issues are solved with pull requests from the community |
take |
…47794) * BUG: fixed OutOfBoundsDatetime exception when errors=coerce #45319 * BUG: Added test and release note #45319 * BUG: Restructured test parameters #45319 * BUG: Restructured test #45319 * BUG: Restructured parameters for test #45319 * BUG: Renamed test and added raise and ignore cases #45319 * BUG: Changed exception case #45319 Co-authored-by: Steven Rotondo <steven.rotondo75@gmail.com>
…v#45319 (pandas-dev#47794) * BUG: fixed OutOfBoundsDatetime exception when errors=coerce pandas-dev#45319 * BUG: Added test and release note pandas-dev#45319 * BUG: Restructured test parameters pandas-dev#45319 * BUG: Restructured test pandas-dev#45319 * BUG: Restructured parameters for test pandas-dev#45319 * BUG: Renamed test and added raise and ignore cases pandas-dev#45319 * BUG: Changed exception case pandas-dev#45319 Co-authored-by: Steven Rotondo <steven.rotondo75@gmail.com>
…v#45319 (pandas-dev#47794) * BUG: fixed OutOfBoundsDatetime exception when errors=coerce pandas-dev#45319 * BUG: Added test and release note pandas-dev#45319 * BUG: Restructured test parameters pandas-dev#45319 * BUG: Restructured test pandas-dev#45319 * BUG: Restructured parameters for test pandas-dev#45319 * BUG: Renamed test and added raise and ignore cases pandas-dev#45319 * BUG: Changed exception case pandas-dev#45319 Co-authored-by: Steven Rotondo <steven.rotondo75@gmail.com>
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 master branch of pandas.
Reproducible Example
Issue Description
Calling
to_datetime
on 51 or more rows ofdatetime
values causes these nested errors:and
This is despite being called with
errors="coerce"
andutc=True
.These errors do not appear if:
to_datetime
is called:pd.to_datetime(series.astype("str"), errors="coerce", utc=True)
Note that even a simpler call like
series.value_counts()
produces the same error.Expected Behavior
51 rows with the 1991 date converted to datetime and the 1446 date converted to
NaT
.Installed Versions
1.4.0rc0:
INSTALLED VERSIONS
commit : d023ba7
python : 3.9.7.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22000
machine : AMD64
processor : Intel64 Family 6 Model 126 Stepping 5, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 1.4.0rc0
numpy : 1.22.0
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.3
setuptools : 57.4.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
zstandard : None
1.3.5:
INSTALLED VERSIONS
commit : 66e3805
python : 3.9.7.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22000
machine : AMD64
processor : Intel64 Family 6 Model 126 Stepping 5, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 1.3.5
numpy : 1.22.0
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.3
setuptools : 57.4.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: