-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
BUG:: Series of timedelta + TimedeltaIndex gets casted to int64 #17250
Comments
hmm, this works when wrapped with a Series. must not be converting somewhere. welcome for you to have a look. Note the current version of pandas is 0.20.3. |
simple repro
|
It is caused by
|
actually both of these examples should raise of course if ns precision then these should both work |
So first here is wrong as well (but showing deprecation warning, which is good), should do the same for
|
All the examples listed here now work on master. |
can u do a PR which adds this to the appropriate whatsnew note and add this example as a test (or point to a similiar test) |
Moratorium on new PRs for a little while. This is listed in #18824, so it'll happen eventually. |
Code Sample, a copy-pastable example if possible
Problem description
When adding a
TimedeltaIndex
and aSeries
withdtype=timedelta64
, one would expect the output to havedtype=timedelta64
, but instead it gets promoted todtype=int64
. This is easy to work around by calling.astype("timedelta64[ns]")
or using the underlying numpyTimedeltaIndex.values
and hence pretty minor, but I figured I'd report it. I believe this regression was introduced around 0.18; the above code works as expected in 0.15.2.Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.75-el6.x86_64.lime.1
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.utf8
LOCALE: None.None
pandas: 0.20.3
pytest: None
pip: 7.1.0
setuptools: 19.4
Cython: None
numpy: 1.13.1
scipy: None
xarray: None
IPython: 5.1.0
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.2
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: