Skip to content

BUG: pandas.tseries.offsets.Second() division #57264

Open
@famenzel

Description

@famenzel

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 pandas.tseries.offsets as tso
a = tso.Second()/10
b = tso.Second()*.1

Issue Description

In contrast to tso.Minute(), tso.Day(), division with tso.Second() with any integer always results in tso.Day(0) (a). This is not the case with the corresponding multiplication (b). In previous pandas versions this did not happen.

Expected Behavior

tso.Second()/10 should return tso.Milli(100) and not tso.Day(0).

Installed Versions

INSTALLED VERSIONS

commit : f538741
python : 3.10.11.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22621
machine : AMD64
processor : Intel64 Family 6 Model 154 Stepping 4, GenuineIntel
byteorder : little
LC_ALL : None
LANG : de_DE.UTF-8
LOCALE : de_DE.cp1252

pandas : 2.2.0
numpy : 1.25.2
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 65.5.0
pip : 23.0.1
Cython : None
pytest : 7.4.0
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.14.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.7.3
numba : 0.58.0
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.11.3
sqlalchemy : 2.0.19
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None

Metadata

Metadata

Assignees

Labels

BugFrequencyDateOffsetsRegressionFunctionality that used to work in a prior pandas version

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions