Open kdebrab opened 2 months ago
take
FYI, the same error happens when resampling to daily resolution when the last day is the day before the DST:
ts = pd.Series(1, pd.date_range("2024-04-19", "2024-04-25", tz="Africa/Cairo", freq="15min"))
ts.resample("D").sum()
It doesn't fail anymore as soon as the end is later, e.g.:
ts = pd.Series(1, pd.date_range("2024-04-19", "2024-04-27", tz="Africa/Cairo", freq="15min"))
ts.resample("D").sum()
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 of pandas.
[ ] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Above fails with
pytz.exceptions.NonExistentTimeError: 2024-04-26 00:00:00
even though that date falls outside the date range.Strangely, when the end date is later, and thus the problematic date is included in the result, it doesn't fail anymore:
returns:
Expected Behavior
No failure and the correct result, namely:
Installed Versions