Skip to content

Commit b585b5a

Browse files
gliptakjreback
authored andcommitted
TST: Add test to validate resampling GH9915
closes #9915 Author: Gábor Lipták <[email protected]> Closes #12913 from gliptak/resample1 and squashes the following commits: aa3206a [Gábor Lipták] Add test to validate resampling GH9915
1 parent f6d0d08 commit b585b5a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pandas/tseries/tests/test_resample.py

+15
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,21 @@ def test_resample_upsample(self):
976976

977977
self.assertEqual(result.index.name, 'index')
978978

979+
def test_resample_how_method(self):
980+
# GH9915
981+
s = pd.Series([11, 22],
982+
index=[Timestamp('2015-03-31 21:48:52.672000'),
983+
Timestamp('2015-03-31 21:49:52.739000')])
984+
expected = pd.Series([11, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN, 22],
985+
index=[Timestamp('2015-03-31 21:48:50'),
986+
Timestamp('2015-03-31 21:49:00'),
987+
Timestamp('2015-03-31 21:49:10'),
988+
Timestamp('2015-03-31 21:49:20'),
989+
Timestamp('2015-03-31 21:49:30'),
990+
Timestamp('2015-03-31 21:49:40'),
991+
Timestamp('2015-03-31 21:49:50')])
992+
assert_series_equal(s.resample("10S").mean(), expected)
993+
979994
def test_resample_extra_index_point(self):
980995
# GH 9756
981996
index = DatetimeIndex(start='20150101', end='20150331', freq='BM')

0 commit comments

Comments
 (0)