Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ from pandas._libs.tslibs.offsets import Day

from pandas._libs.tslibs.util cimport (
is_array,
is_bool_object,
is_float_object,
is_integer_object,
)
Expand Down Expand Up @@ -2311,6 +2312,13 @@ class Timedelta(_Timedelta):
return self.__mul__(item)
return other * self.to_timedelta64()

elif is_bool_object(other):
# GH#62316
raise TypeError(
"Cannot multiply Timedelta by bools. "
"Explicitly cast to integers instead."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool and integer singular

)

return NotImplemented

__rmul__ = __mul__
Expand Down
Loading