-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
BugError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasPeriodPeriod data typePeriod data typeResampleresample methodresample methodTimezonesTimezone data dtypeTimezone data dtype
Description
Code Sample
from pytz import timezone
index = DatetimeIndex(['2019-01-01 06:00', '2019-01-01 07:00', '2019-01-01 08:00'], tz=timezone('Europe/Berlin'))
s = Series(index=index, data=[1, 2, 3])
print(s.index.tz)
rs = s.resample("3h", kind="period").sum()
for x in rs.index:
print(x.start_time.tz)
print(x.end_time.tz)
Problem description
All the Periods in the resampled PeriodIndex should have their start_time and end_time TimeStamps set with the correct Timezone.
Since the the DateTimeIndex was tz aware the attributes in the PeriodIndex should be too.
This is probably related to #13238 and #15777
Expected Output
Europe/Berlin
Europe/Berlin
Europe/Berlin
Tested Version
pandas 0.25.0
Metadata
Metadata
Assignees
Labels
BugError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasPeriodPeriod data typePeriod data typeResampleresample methodresample methodTimezonesTimezone data dtypeTimezone data dtype