Skip to content

Commit 6ecee75

Browse files
committed
bug fix
1 parent f5361ec commit 6ecee75

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pandas/tests/indexes/datetimes/test_tools.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ def test_epoch(self, units, epochs, epoch_1960, units_from_epochs):
16101610
[('random_string', ValueError),
16111611
('epoch', ValueError),
16121612
('13-24-1990', ValueError),
1613-
('0001-01-01', tslib.OutOfBoundsDatetime)])
1613+
(datetime(1, 1, 1), tslib.OutOfBoundsDatetime)])
16141614
def test_invalid_origins(self, origin, exc, units, units_from_epochs):
16151615

16161616
with pytest.raises(exc):

pandas/tseries/tdi.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ def _evaluate_with_timedelta_like(self, other, op, opstr):
334334
"division by pd.NaT not implemented")
335335

336336
i8 = self.asi8
337-
result = op(i8, other.value)
337+
if opstr in ['__floordiv__']:
338+
result = i8 // other.value
339+
else:
340+
result = op(i8, float(other.value))
338341
result = self._maybe_mask_results(result, convert='float64')
339342
return Index(result, name=self.name, copy=False)
340343

0 commit comments

Comments
 (0)