We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d73d62 commit 7e10d08Copy full SHA for 7e10d08
pandas/_libs/tslibs/timedeltas.pyx
@@ -83,6 +83,7 @@ from pandas._libs.tslibs.offsets import Day
83
84
from pandas._libs.tslibs.util cimport (
85
is_array,
86
+ is_bool_object,
87
is_float_object,
88
is_integer_object,
89
)
@@ -2311,6 +2312,13 @@ class Timedelta(_Timedelta):
2311
2312
return self.__mul__(item)
2313
return other * self.to_timedelta64()
2314
2315
+ elif is_bool_object(other):
2316
+ # GH#62316
2317
+ raise TypeError(
2318
+ "Cannot multiply Timedelta by bools. "
2319
+ "Explicitly cast to integers instead."
2320
+ )
2321
+
2322
return NotImplemented
2323
2324
__rmul__ = __mul__
0 commit comments