A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/53481 below:

Resample with PeriodIndex? · Issue #53481 · pandas-dev/pandas · GitHub

Resampling with PeriodIndex is very very broken:

pi = pd.period_range(start="2000", periods=3, freq="M")
ser= pd.Series(["foo", "bar", "baz"], index=pi)
rs = ser.resample("M")  # should be a no-op!

>>> rs.nunique()
2000-01    foo
2000-02    bar
2000-03    baz
Freq: M, dtype: object

Some of this is because in PeriodIndexResampler._downsample (which many methods go through) we just return self.asfreq() in many cases which is very much wrong. We have some xfailed tests (e.g. test_resample_nat_index_series) that cause this as well as some actively-incorrect tests (e.g. test_resample_empty_dtypes, test_resample_same_freq)

Is this worth fixing or should we just deprecate it?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4