
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
BUG: to_datetime raises when errors=coerce and infer_datetime_format Β· Issue #48633 Β· pandas-dev/pandas
Description:
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 pd....
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Technology & Computing
- Video & Online Content
- Mobile Technology & AI
Content Management System {π}
What CMS is github.com built with?
Github.com uses WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,653,586 visitors per month in the current month.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 5,316,011 paying customers.
The estimated monthly recurring revenue (MRR) is $22,327,244.
The estimated annual recurring revenues (ARR) are $267,926,929.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
bug, marcogorelli, pandas, issue, errorscoerce, todatetime, file, line, datetime, sign, inferdatetimeformat, format, member, projects, raises, homemarcogorellipandasdevpandascoretoolsdatetimespy, navigation, pull, requests, actions, security, closed, description, version, confirmed, exists, pdtodatetime, inferdatetimeformattrue, dayfirstdayfirst, timedeltahours, guessing, triage, reviewed, team, data, dtype, commented, author, github, type, milestone, footer, skip, content, menu, product, solutions, resources, open, source,
Topics {βοΈ}
/home/marcogorelli/pandas-dev/pandas/core/tools/datetimes pandas/_libs/tslibs/parsing issue description traceback dtype='datetime64[ns]' personal information bug comment metadata assignees type projects latest version projects milestone triage issue pandas bug exists infer_datetime_format=true errors=coerce errors='coerce' main branch recent call dayfirst=dayfirst arr[non_nan_elements[0]] invalid offsets milestone relationships to_datetime raises issue to_datetime raising bug github timedelta strictly format _libs tslibs parsing guessing to_datetime pd timedelta timedelta sign skip jump checked reported confirmed reproducible file py line 7 line 1124 argc line 418 arg
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:BUG: to_datetime raises when errors=coerce and infer_datetime_format
articleBody:### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the main branch of pandas.
### Reproducible Example
```python
pd.to_datetime(["200622-12-31", "111111-24-11"], errors='coerce', infer_datetime_format=True)
```
### Issue Description
```
Traceback (most recent call last):
File "t.py", line 7, in <module>
pd.to_datetime(["200622-12-31", "111111-24-11"], errors='coerce', infer_datetime_format=True)
File "/home/marcogorelli/pandas-dev/pandas/core/tools/datetimes.py", line 1124, in to_datetime
result = convert_listlike(argc, format)
File "/home/marcogorelli/pandas-dev/pandas/core/tools/datetimes.py", line 418, in _convert_listlike_datetimes
format = _guess_datetime_format_for_array(arg, dayfirst=dayfirst)
File "/home/marcogorelli/pandas-dev/pandas/core/tools/datetimes.py", line 132, in _guess_datetime_format_for_array
return guess_datetime_format(arr[non_nan_elements[0]], dayfirst=dayfirst)
File "pandas/_libs/tslibs/parsing.pyx", line 1029, in pandas._libs.tslibs.parsing.guess_datetime_format
tokens[offset_index] = parsed_datetime.strftime("%z")
ValueError: offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).
```
Note that this is different from https://github.com/pandas-dev/pandas/issues/46071, because here the error happens when pandas is still guessing the format
### Expected Behavior
```
DatetimeIndex(['NaT', 'NaT'], dtype='datetime64[ns]', freq=None)
```
### Installed Versions
<details>
Replace this line with the output of pd.show_versions()
INSTALLED VERSIONS
------------------
commit : bf856a85a3b769821809ff456e288542af16310c
python : 3.8.13.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.16.3-microsoft-standard-WSL2
Version : #1 SMP Fri Apr 2 22:23:49 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 1.6.0.dev0+145.gbf856a85a3
numpy : 1.22.4
pytz : 2022.2.1
dateutil : 2.8.2
setuptools : 65.3.0
pip : 22.2.2
Cython : 0.29.32
pytest : 7.1.3
hypothesis : 6.54.5
sphinx : 4.5.0
blosc : None
feather : None
xlsxwriter : 3.0.3
lxml.etree : 4.9.1
html5lib : 1.1
pymysql : 1.0.2
psycopg2 : 2.9.3
jinja2 : 3.0.3
IPython : 8.5.0
pandas_datareader: 0.10.0
bs4 : 4.11.1
bottleneck : 1.3.5
brotli :
fastparquet : 0.8.3
fsspec : 2021.11.0
gcsfs : 2021.11.0
matplotlib : 3.5.3
numba : 0.55.2
numexpr : 2.8.3
odfpy : None
openpyxl : 3.0.10
pandas_gbq : 0.17.8
pyarrow : 9.0.0
pyreadstat : 1.1.9
pyxlsb : 1.0.9
s3fs : 2021.11.0
scipy : 1.9.1
snappy :
sqlalchemy : 1.4.41
tables : 3.7.0
tabulate : 0.8.10
xarray : 2022.6.0
xlrd : 2.0.1
xlwt : 1.3.0
zstandard : 0.18.0
tzdata : None
None
</details>
author:
url:https://github.com/MarcoGorelli
type:Person
name:MarcoGorelli
datePublished:2022-09-19T08:24:55.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:2
url:https://github.com/48633/pandas/issues/48633
context:https://schema.org
headline:BUG: to_datetime raises when errors=coerce and infer_datetime_format
articleBody:### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the main branch of pandas.
### Reproducible Example
```python
pd.to_datetime(["200622-12-31", "111111-24-11"], errors='coerce', infer_datetime_format=True)
```
### Issue Description
```
Traceback (most recent call last):
File "t.py", line 7, in <module>
pd.to_datetime(["200622-12-31", "111111-24-11"], errors='coerce', infer_datetime_format=True)
File "/home/marcogorelli/pandas-dev/pandas/core/tools/datetimes.py", line 1124, in to_datetime
result = convert_listlike(argc, format)
File "/home/marcogorelli/pandas-dev/pandas/core/tools/datetimes.py", line 418, in _convert_listlike_datetimes
format = _guess_datetime_format_for_array(arg, dayfirst=dayfirst)
File "/home/marcogorelli/pandas-dev/pandas/core/tools/datetimes.py", line 132, in _guess_datetime_format_for_array
return guess_datetime_format(arr[non_nan_elements[0]], dayfirst=dayfirst)
File "pandas/_libs/tslibs/parsing.pyx", line 1029, in pandas._libs.tslibs.parsing.guess_datetime_format
tokens[offset_index] = parsed_datetime.strftime("%z")
ValueError: offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).
```
Note that this is different from https://github.com/pandas-dev/pandas/issues/46071, because here the error happens when pandas is still guessing the format
### Expected Behavior
```
DatetimeIndex(['NaT', 'NaT'], dtype='datetime64[ns]', freq=None)
```
### Installed Versions
<details>
Replace this line with the output of pd.show_versions()
INSTALLED VERSIONS
------------------
commit : bf856a85a3b769821809ff456e288542af16310c
python : 3.8.13.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.16.3-microsoft-standard-WSL2
Version : #1 SMP Fri Apr 2 22:23:49 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 1.6.0.dev0+145.gbf856a85a3
numpy : 1.22.4
pytz : 2022.2.1
dateutil : 2.8.2
setuptools : 65.3.0
pip : 22.2.2
Cython : 0.29.32
pytest : 7.1.3
hypothesis : 6.54.5
sphinx : 4.5.0
blosc : None
feather : None
xlsxwriter : 3.0.3
lxml.etree : 4.9.1
html5lib : 1.1
pymysql : 1.0.2
psycopg2 : 2.9.3
jinja2 : 3.0.3
IPython : 8.5.0
pandas_datareader: 0.10.0
bs4 : 4.11.1
bottleneck : 1.3.5
brotli :
fastparquet : 0.8.3
fsspec : 2021.11.0
gcsfs : 2021.11.0
matplotlib : 3.5.3
numba : 0.55.2
numexpr : 2.8.3
odfpy : None
openpyxl : 3.0.10
pandas_gbq : 0.17.8
pyarrow : 9.0.0
pyreadstat : 1.1.9
pyxlsb : 1.0.9
s3fs : 2021.11.0
scipy : 1.9.1
snappy :
sqlalchemy : 1.4.41
tables : 3.7.0
tabulate : 0.8.10
xarray : 2022.6.0
xlrd : 2.0.1
xlwt : 1.3.0
zstandard : 0.18.0
tzdata : None
None
</details>
author:
url:https://github.com/MarcoGorelli
type:Person
name:MarcoGorelli
datePublished:2022-09-19T08:24:55.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:2
url:https://github.com/48633/pandas/issues/48633
Person:
url:https://github.com/MarcoGorelli
name:MarcoGorelli
url:https://github.com/MarcoGorelli
name:MarcoGorelli
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:2
interactionType:https://schema.org/CommentAction
userInteractionCount:2
External Links {π}(3)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net