From 545da27d56c4ec65401e43427f70f01c15995dd3 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Tue, 16 Feb 2016 10:23:09 -0500 Subject: [PATCH] TST: confirming tests for #12348 --- doc/source/whatsnew/v0.18.0.txt | 2 +- pandas/tseries/tests/test_resample.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.18.0.txt b/doc/source/whatsnew/v0.18.0.txt index 47e78cf558a16..00c7d1d31047f 100644 --- a/doc/source/whatsnew/v0.18.0.txt +++ b/doc/source/whatsnew/v0.18.0.txt @@ -615,7 +615,7 @@ other anchored offsets like ``MonthBegin`` and ``YearBegin``. Resample API ^^^^^^^^^^^^ -Like the change in the window functions API :ref:`above `, ``.resample(...)`` is changing to have a more groupby-like API. (:issue:`11732`, :issue:`12702`, :issue:`12202`, :issue:`12332`). +Like the change in the window functions API :ref:`above `, ``.resample(...)`` is changing to have a more groupby-like API. (:issue:`11732`, :issue:`12702`, :issue:`12202`, :issue:`12332`, :issue:`12348`). .. ipython:: python diff --git a/pandas/tseries/tests/test_resample.py b/pandas/tseries/tests/test_resample.py index 262526f3f4c7c..91922ef5aa9e1 100644 --- a/pandas/tseries/tests/test_resample.py +++ b/pandas/tseries/tests/test_resample.py @@ -938,6 +938,18 @@ def test_resample_ohlc_result(self): b = s.loc[:'4-14-2000'].resample('30T').ohlc() self.assertIsInstance(b, DataFrame) + # GH12348 + # raising on odd period + rng = date_range('2013-12-30', '2014-01-07') + index = rng.drop([Timestamp('2014-01-01'), + Timestamp('2013-12-31'), + Timestamp('2014-01-04'), + Timestamp('2014-01-05')]) + df = DataFrame(data=np.arange(len(index)), index=index) + result = df.resample('B').mean() + expected = df.reindex(index=date_range(rng[0], rng[-1], freq='B')) + assert_frame_equal(result, expected) + def test_resample_ohlc_dataframe(self): df = ( pd.DataFrame({