sum() is giving 0.0 as the total, rather than NaN, when the entire row/column is NaN.

Note that this bug does not arise in pandas 17.1 with numpy 1.11.0, running on Ubuntu.

Code Sample, a copy-pastable example if possible

import numpy as np
df = pd.DataFrame([[np.nan,np.nan,np.nan,np.nan],
              [1,np.nan,np.nan,np.nan],[2,2,2,np.nan]],columns=['a','b','c','d'])
df.sum(skipna=True)   # should be true by default. Same result if argument is omitted

Actual Output

a 3.0 b 2.0 c 2.0 d 0.0

Expected Output

a 3.0 b 2.0 c 2.0 d NaN

output of pd.show_versions()

INSTALLED VERSIONS

commit: None python: 2.7.6.final.0 python-bits: 64 OS: Darwin OS-release: 15.6.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8

pandas: 0.18.1 nose: 1.3.7 pip: 8.1.2 setuptools: 23.1.0 Cython: 0.24 numpy: 1.11.1 scipy: 0.17.1 statsmodels: 0.6.1 xarray: None IPython: 4.1.2 sphinx: None patsy: 0.4.1 dateutil: 2.2 pytz: 2014.7 blosc: None bottleneck: 1.1.0 tables: 3.2.2 numexpr: 2.6.0 matplotlib: 1.5.1 openpyxl: 2.3.4 xlrd: 0.9.4 xlwt: None xlsxwriter: None lxml: 3.6.0 bs4: 4.4.1 html5lib: 0.999 httplib2: 0.8 apiclient: 1.2 sqlalchemy: 1.0.12 pymysql: None psycopg2: 2.5.4 (dt dec pq3 ext) jinja2: 2.7.2 boto: 2.40.0 pandas_datareader: None

Comment From: jorisvandenbossche

This is a know issue, and depends on the versions of numpy and bottleneck you have installed. See https://github.com/pydata/pandas/issues/9422 for the discussion about what pandas should do.

Comment From: amillb

Sorry for the duplicate...I missed this in the open issues.