You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Available workarounds:
Convert dates to UTC and operate on UTC timezone - this will prevent the error, but will cause dates to be bucketed in the wrong month if datetimes are close to the month start/end. The further the tz is from UTC, the more noticeable the problem.
Expected Behavior
I would expect Month Start to use a valid date, like 2017-10-01 01:00:00 as the start of the month. nonexistent='shift_forward' argument to Grouper would be appreciated to control this behaviour.
Installed Versions
INSTALLED VERSIONS
commit : e86ed37
python : 3.10.4.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22621
machine : AMD64
processor : Intel64 Family 6 Model 186 Stepping 2, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_Ireland.1252
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
Issue Description
Month Start Grouper raises NonExistentTimeError in some timezones where DST starts on first dat of the month at midnight.
For example in America/Asuncion DST starts on 1st October at midnight.
Running the above example raises the following error:
Available workarounds:
Convert dates to UTC and operate on UTC timezone - this will prevent the error, but will cause dates to be bucketed in the wrong month if datetimes are close to the month start/end. The further the tz is from UTC, the more noticeable the problem.
Expected Behavior
I would expect Month Start to use a valid date, like
2017-10-01 01:00:00
as the start of the month.nonexistent='shift_forward'
argument toGrouper
would be appreciated to control this behaviour.Installed Versions
INSTALLED VERSIONS
commit : e86ed37
python : 3.10.4.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22621
machine : AMD64
processor : Intel64 Family 6 Model 186 Stepping 2, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_Ireland.1252
pandas : 2.1.1
numpy : 1.22.4
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 68.2.2
pip : 22.3.1
Cython : None
pytest : None
hypothesis : None
sphinx : 6.2.1
blosc : None
feather : None
xlsxwriter : 3.1.2
lxml.etree : 4.9.1
html5lib : 1.1
pymysql : None
psycopg2 : 2.9.3
jinja2 : 3.1.2
IPython : 8.16.1
pandas_datareader : None
bs4 : 4.11.1
bottleneck : None
dataframe-api-compat: None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : 0.9.0
xarray : None
xlrd : 2.0.1
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: