-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Description
Code Sample, a copy-pastable example if possible
# Your code here
In [8]: pd.to_timedelta('1', unit='h')
Out[8]: Timedelta('0 days 00:00:00.000000')
Problem description
I would expect all the following to return Timedelta('0 days 01:00:00'). pd.to_timedelta(1, unit='h') does not. I must first cast the string '1' to a int or float then to a timedelta.
In [6]: pd.to_timedelta(1.0, unit='h')
Out[6]: Timedelta('0 days 01:00:00')
In [7]: pd.to_timedelta(1, unit='h')
Out[7]: Timedelta('0 days 01:00:00')
In [8]: pd.to_timedelta('1', unit='h')
Out[8]: Timedelta('0 days 00:00:00.000000')
In [9]: pd.to_timedelta('1 H')
Out[9]: Timedelta('0 days 01:00:00')
Expected Output
Output of pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.1.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None
pandas: 0.20.2
pytest: 3.1.2
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.12.1
scipy: 0.19.0
xarray: None
IPython: 6.0.0
sphinx: None
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.6.2
feather: None
matplotlib: 2.0.0
openpyxl: None
xlrd: 1.0.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.5.3
html5lib: 0.999999999
sqlalchemy: 1.1.5
pymysql: None
psycopg2: None
jinja2: 2.9.4
s3fs: None
pandas_gbq: None
pandas_datareader: None