Skip to content

BUG: Inconsistent multiplication of bool times Timedelta #62316

@Dr-Irv

Description

@Dr-Irv

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import datetime as dt
import pandas as pd
dt.timedelta(days=1) * True  #  Works
pd.Timedelta("1 day") * True  # Fails in 2.3.2 and in main
pd.Series([True, False]) * pd.timedelta_range(start="1 day", end="2 days")  # Works in 2.3.2, fails in main

Issue Description

See above. Multiplying a bool times a Timedelta is inconsistent.

In version 2.3.2, you can't multiply a single bool and a pd.Timedelta object, but you can multiply them if they are in a Series.

In main ('3.0.0.dev0+2389.g452c7fb6a4'), you cannot multiply when in a Series.

Note that using datetime.timedelta, you can multiply a boolean with a Timedelta

Expected Behavior

I think multiplication of a Timedelta times a bool should work like it does for datetime.timedelta

Installed Versions

INSTALLED VERSIONS

commit : 452c7fb
python : 3.11.13
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.26100
machine : AMD64
processor : Intel64 Family 6 Model 183 Stepping 1, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252

pandas : 3.0.0.dev0+2389.g452c7fb6a4
numpy : 2.3.3
dateutil : 2.9.0.post0
pip : 25.1
Cython : None
sphinx : None
IPython : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.5
bottleneck : None
fastparquet : None
fsspec : None
html5lib : 1.1
hypothesis : None
gcsfs : None
jinja2 : 3.1.6
lxml.etree : 6.0.1
matplotlib : 3.10.6
numba : None
numexpr : 2.12.1
odfpy : None
openpyxl : 3.1.5
psycopg2 : None
pymysql : None
pyarrow : 21.0.0
pyiceberg : None
pyreadstat : 1.3.1
pytest : N/A
python-calamine : None
pytz : 2025.2
pyxlsb : 1.0.10
s3fs : None
scipy : 1.16.1
sqlalchemy : 2.0.43
tables : 3.10.2
tabulate : 0.9.0
xarray : 2025.9.0
xlrd : 2.0.2
xlsxwriter : 3.2.5
zstandard : 0.24.0
qtpy : None
pyqt5 : None

Metadata

Metadata

Assignees

Labels

BugNumeric OperationsArithmetic, Comparison, and Logical operationsTimedeltaTimedelta data type

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions