-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Summation of NaT in a DataFrame with axis=1 does not return NaT #17235
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
Comments
you are specifying |
|
with
so whatever skipna value is, I never get |
again you are specifying |
and if I don't skip What means According doc
so if
|
|
@jreback - I think this is buggy, we're not respecting NaT sematics, but instead including the sentinel value in the sum.
|
these are converted to i8 before adding (and then masked which is not happening i guess) |
Looks to be fixed on master now. Could use a regression test.
|
'''
sum of s2 gives NaT but sum(axis=1,skipna=False) still does not give NaT. I believe this still needs a fix? |
Ah good catch @ainsleyto. Yes looks like |
From poking at this, this can be fixed by removing from nanops.nansum
and adjusting |
Thanks @jbrockmendel and all for this fix |
Code Sample, a copy-pastable example if possible
Problem description
This code displays
Expected Output
That's very strange because
pd.to_timedelta(500, unit='ms') + pd.NaT
returnsNaT
(which is expected) but it's doesn't work as expected when summingSeries
)Output of
pd.show_versions()
: pd.show_versions()
/Users/scls/anaconda/lib/python3.6/site-packages/xarray/core/formatting.py:16: FutureWarning: The pandas.tslib module is deprecated and will be removed in a future version.
from pandas.tslib import OutOfBoundsDatetime
INSTALLED VERSIONS
commit: None
python: 3.6.1.final.0
python-bits: 64
OS: Darwin
OS-release: 16.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: fr_FR.UTF-8
LOCALE: fr_FR.UTF-8
pandas: 0.20.1
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: 0.9.5
IPython: 5.3.0
sphinx: 1.5.6
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: 1.2.1
tables: 3.3.0
numexpr: 2.6.2
feather: None
matplotlib: 2.0.2
openpyxl: 2.4.7
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: 3.7.3
bs4: 4.6.0
html5lib: 0.999
sqlalchemy: 1.1.9
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: 0.5.0
The text was updated successfully, but these errors were encountered: