Skip to content

BUG: Series.resample fails on NaT PeriodIndex #39227

Closed
@rhshadrach

Description

@rhshadrach

Failure is only on Series and only when the index is entirely NaT.

freq = "D"

df = DataFrame([1, 2], index=PeriodIndex([NaT, NaT], freq=freq))
print(df.resample(freq).sum())

ser = Series([1, 2], index=PeriodIndex([NaT, NaT], freq=freq))
print(ser.resample(freq).sum())

Second raises, first returns the expected

Empty DataFrame
Columns: []
Index: []

Metadata

Metadata

Assignees

Labels

BugMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateResampleresample methodSeriesSeries data structure

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions