BUG: TimedeltaIndex.__rfloordiv__ triggers ZeroDivisionError when other is a list but works for scalar #54554
Labels
Bug
Index
Related to the Index class or subclasses
Numeric Operations
Arithmetic, Comparison, and Logical operations
Timedelta
Timedelta data type
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
Issue Description
I would expect the same behavior in the above two examples.
edit: and the dtype and the result should be the same (see object and inf)
Expected Behavior
Scalar works, but it raises with the same scalar in a list.
xref pandas-dev/pandas-stubs#764
Installed Versions
INSTALLED VERSIONS
commit : 0f43794
python : 3.11.4.final.0
python-bits : 64
OS : Linux
OS-release : 6.4.7-200.fc38.x86_64
Version : #1 SMP PREEMPT_DYNAMIC Thu Jul 27 20:01:18 UTC 2023
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.0.3
numpy : 1.25.2
pytz : 2023.3
dateutil : 2.8.2
setuptools : 68.0.0
pip : 23.0.1
Cython : 3.0.0
pytest : 7.4.0
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.1.2
lxml.etree : 4.9.3
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
brotli : None
fastparquet : None
fsspec : 2023.6.0
gcsfs : None
matplotlib : 3.7.2
numba : None
numexpr : 2.8.4
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 12.0.1
pyreadstat : 1.2.2
pyxlsb : 1.0.10
s3fs : None
scipy : 1.9.3
snappy : None
sqlalchemy : 2.0.19
tables : 3.8.0
tabulate : 0.9.0
xarray : 2023.1.0
xlrd : 2.0.1
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: