Skip to content

Commit 2e9a774

Browse files
committed
TST: confirming tests for pandas-dev#12348
xref pandas-dev#12348 Author: Jeff Reback <[email protected]> Closes pandas-dev#12349 from jreback/resample_tests and squashes the following commits: 545da27 [Jeff Reback] TST: confirming tests for pandas-dev#12348
1 parent 3358afc commit 2e9a774

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

doc/source/whatsnew/v0.18.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ other anchored offsets like ``MonthBegin`` and ``YearBegin``.
615615
Resample API
616616
^^^^^^^^^^^^
617617

618-
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`, :issue:`12702`, :issue:`12202`, :issue:`12332`).
618+
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`, :issue:`12702`, :issue:`12202`, :issue:`12332`, :issue:`12348`).
619619

620620
.. ipython:: python
621621

pandas/tseries/tests/test_resample.py

+12
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,18 @@ def test_resample_ohlc_result(self):
938938
b = s.loc[:'4-14-2000'].resample('30T').ohlc()
939939
self.assertIsInstance(b, DataFrame)
940940

941+
# GH12348
942+
# raising on odd period
943+
rng = date_range('2013-12-30', '2014-01-07')
944+
index = rng.drop([Timestamp('2014-01-01'),
945+
Timestamp('2013-12-31'),
946+
Timestamp('2014-01-04'),
947+
Timestamp('2014-01-05')])
948+
df = DataFrame(data=np.arange(len(index)), index=index)
949+
result = df.resample('B').mean()
950+
expected = df.reindex(index=date_range(rng[0], rng[-1], freq='B'))
951+
assert_frame_equal(result, expected)
952+
941953
def test_resample_ohlc_dataframe(self):
942954
df = (
943955
pd.DataFrame({

0 commit comments

Comments
 (0)