Skip to content

Commit 83238ed

Browse files
committed
BUG: timedelta resample idempotency, #12072
1 parent e570570 commit 83238ed

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

doc/source/whatsnew/v0.18.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ Resample API
359359
^^^^^^^^^^^^
360360

361361
Like the change in the window functions API :ref:`above <whatsnew_0180.enhancements.moments>`, ``.resample(...)`` is changing to have
362-
a more groupby-like API. (:issue:`11732`).
362+
a more groupby-like API. (:issue:`11732`, :issue:`12702`).
363363

364364
.. ipython:: python
365365

pandas/tseries/tests/test_resample.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,15 @@ def test_resample_single_period_timedelta(self):
522522
'1 day', freq='2s', periods=3))
523523
assert_series_equal(result, expected)
524524

525+
def test_resample_timedelta_idempotency(self):
526+
527+
# GH 12072
528+
index = pd.timedelta_range('0', periods=9, freq='10L')
529+
series = pd.Series(range(9), index=index)
530+
result = series.resample('10L').mean()
531+
expected = series
532+
assert_series_equal(result, expected)
533+
525534
def test_resample_rounding(self):
526535
# GH 8371
527536
# odd results when rounding is needed

0 commit comments

Comments
 (0)