Skip to content

Commit

Permalink
BUG: timedelta resample idempotency, pandas-dev#12072
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Feb 2, 2016
1 parent e570570 commit 83238ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.18.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ Resample API
^^^^^^^^^^^^

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

.. ipython:: python

Expand Down
9 changes: 9 additions & 0 deletions pandas/tseries/tests/test_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,15 @@ def test_resample_single_period_timedelta(self):
'1 day', freq='2s', periods=3))
assert_series_equal(result, expected)

def test_resample_timedelta_idempotency(self):

# GH 12072
index = pd.timedelta_range('0', periods=9, freq='10L')
series = pd.Series(range(9), index=index)
result = series.resample('10L').mean()
expected = series
assert_series_equal(result, expected)

def test_resample_rounding(self):
# GH 8371
# odd results when rounding is needed
Expand Down

0 comments on commit 83238ed

Please sign in to comment.