Timedeltas cast as datetime in DataFrames #15560
Labels
Bug
Datetime
Datetime data dtype
Duplicate Report
Duplicate issue or pull request
Timedelta
Timedelta data type
Code Sample, a copy-pastable example if possible
Problem description
For dataframe, the value "5844 days" is cast as a datetime, so it becomes "1970-01-01 + 5844 days = 1986-01-01"
Expected Output
In [10]: pandas.DataFrame([[datetime.datetime(2017, 1, 1)]]) - datetime.datetime(2001, 1, 1)
Out[10]:
0
0 5844 days
Output of
pd.show_versions()
pandas: 0.19.0+527.g211ecd5
pytest: 3.0.6
pip: 9.0.1
setuptools: 22.0.0
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.1
xarray: None
IPython: 4.2.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: