Skip to content

Commit 190bed2

Browse files
committed
Updated condition in if-statement
1 parent e79dac7 commit 190bed2

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

pandas/tests/test_tseries.py

-3
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,6 @@ def test_resample_with_timedeltaindex():
432432
resample = df.resample('10s', base = 5)
433433
assert_almost_equal(resample.index[0].seconds, 5)
434434

435-
with tm.assertRaises(Exception):
436-
df.resample('10s', base=15)
437-
438435
class TestBinGroupers(tm.TestCase):
439436
_multiprocess_can_split_ = True
440437

pandas/tseries/resample.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,8 @@ def _resample_timestamps(self, kind=None):
323323

324324
result.index = result.index + loffset
325325

326-
base_freq = (type(self.freq))(self.base)
327-
if (base_freq > self.freq):
328-
raise Exception("Value of base must be between 0 and {freq}, got "
329-
"{base} instead".format(freq=self.freq.n, base=self.base))
330-
331-
result.index = result.index.shift(self.base, type(self.freq)(1))
326+
if self.base > 0:
327+
result.index = result.index.shift(self.base, self.freq)
332328

333329
return result
334330

0 commit comments

Comments
 (0)