Skip to content

to_timedelta str int discrepancy #30850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
harishmk opened this issue Jan 9, 2020 · 1 comment
Closed

to_timedelta str int discrepancy #30850

harishmk opened this issue Jan 9, 2020 · 1 comment

Comments

@harishmk
Copy link

harishmk commented Jan 9, 2020

Code Sample, a copy-pastable example if possible

assert pd.to_timedelta(1,unit='s') == pd.to_timedelta('1',unit='s')

fails

>>> pd.to_timedelta(20000,unit='s')
Timedelta('0 days 05:33:20')

>>> pd.to_timedelta('20000',unit='s')
Timedelta('0 days 00:00:00.000020')

Problem description

it looks like the unit parameter has no effect in pd.to_timedelta('1',unit='s')

Expected Output

Output of pd.show_versions()

INSTALLED VERSIONS

commit : None
python : 3.6.3.final.0
python-bits : 64
OS : Linux
OS-release : 3.10.0-957.27.2.el7.x86_64
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 0.25.3
numpy : 1.16.4
pytz : 2019.1
dateutil : 2.8.0
pip : 19.3.1
setuptools : 41.0.1
Cython : 0.29.13
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.3.3
html5lib : 1.0.1
pymysql : None
psycopg2 : 2.8.3 (dt dec pq3 ext lo64)
jinja2 : 2.10.1
IPython : 7.5.0
pandas_datareader: None
bs4 : 4.8.0
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : 4.3.3
matplotlib : 3.1.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.13.0
pytables : None
s3fs : None
scipy : None
sqlalchemy : 1.3.7
tables : None
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : None

@mroeschke
Copy link
Member

Thanks for the report. Duplicate of #12136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants