Skip to content

Commit 22e3802

Browse files
committed
TST: span unit test #1635
1 parent 495b608 commit 22e3802

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

pandas/tseries/resample.py

+3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def __init__(self, freq='Min', closed='right', label='right', how='mean',
4343
self.label = label
4444
self.nperiods = nperiods
4545
self.kind = kind
46+
4647
self.convention = convention or 'E'
48+
self.convention = convention.lower()
49+
4750
self.axis = axis
4851
self.loffset = loffset
4952
self.how = how

pandas/tseries/tests/test_resample.py

+13
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,19 @@ def test_quarterly_resampling(self):
787787
exp = ts.to_timestamp().resample('A').to_period()
788788
assert_series_equal(result, exp)
789789

790+
# def test_monthly_convention_span(self):
791+
# rng = period_range('2000-01', periods=3, freq='M')
792+
# ts = Series(np.arange(3), index=rng)
793+
794+
# # hacky way to get same thing
795+
# exp_index = period_range('2000-01-01', '2000-03-31', freq='D')
796+
# expected = ts.asfreq('D', how='end').reindex(exp_index)
797+
# expected = expected.fillna(method='bfill')
798+
799+
# result = ts.resample('D', convention='span')
800+
801+
# assert_series_equal(result, expected)
802+
790803
class TestTimeGrouper(unittest.TestCase):
791804

792805
def setUp(self):

0 commit comments

Comments
 (0)