<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<p dir="auto">`<br>
import pandas as pd</p>
<p dir="auto">df = pd.DataFrame([[0,0],[1,1],[np.NaN,0],[np.NaN,1],[np.NaN,np.NaN]], columns = ['a','b'])</p>
<p dir="auto">df<br>
Out[3]:<br>
a    b<br>
0  0.0  0.0<br>
1  1.0  1.0<br>
2  NaN  0.0<br>
3  NaN  1.0<br>
4  NaN  NaN</p>
<p dir="auto">df.sum(axis=1, skipna=True)<br>
Out[4]:<br>
0    0.0<br>
1    2.0<br>
2    0.0<br>
3    1.0<br>
4    0.0<br>
dtype: float64<br>
`</p>
<h4 dir="auto">Problem description</h4>
<p dir="auto">The <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.sum.html" rel="nofollow">documentation</a> for pandas.DataFrame.sum indicates that:</p>
<blockquote>
<p dir="auto">skipna : boolean, default True<br>
Exclude NA/null values. <strong><em>If an entire row/column is NA, the result will be NA</em></strong></p>
</blockquote>
<p dir="auto">However, it appears that the actual behavior under the skipna option within this particular environment is for the summation routine to evaluate full rows of na values to 0 rather than the documented value of NA.</p>
<p dir="auto">Currently this behavior only occurs on within my local windows environment, and NOT within the linux environment my organization's grid runs on.  I have provided output for pd.versions for both environments below to help localize this issue.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">df.sum(axis=1, skipna=True)<br>
Out[6]:<br>
0    0.0<br>
1    2.0<br>
2    0.0<br>
3    1.0<br>
4    NaN<br>
dtype: float64</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<p dir="auto"><em><strong>Windows version in which issue is present</strong></em></p>
<p dir="auto">pd.show_versions()</p>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 2.7.11.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 7<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 45 Stepping 7, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.19.2<br>
nose: 1.3.7<br>
pip: 8.1.1<br>
setuptools: 20.3<br>
Cython: 0.23.4<br>
numpy: 1.11.0<br>
scipy: 0.17.0<br>
statsmodels: 0.6.1<br>
xarray: None<br>
IPython: 4.1.2<br>
sphinx: 1.3.5<br>
patsy: 0.4.0<br>
dateutil: 2.5.1<br>
pytz: 2016.2<br>
blosc: None<br>
bottleneck: 1.0.0<br>
tables: 3.2.2<br>
numexpr: 2.5.2<br>
matplotlib: 1.5.1<br>
openpyxl: 2.3.2<br>
xlrd: 0.9.4<br>
xlwt: 1.0.0<br>
xlsxwriter: 0.8.4<br>
lxml: 3.6.0<br>
bs4: 4.4.1<br>
html5lib: 0.999<br>
httplib2: None<br>
apiclient: None<br>
sqlalchemy: 1.0.12<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.8<br>
boto: 2.39.0<br>
pandas_datareader: None</p>
<p dir="auto"><em><strong>Linux version in which issue is NOT present</strong></em></p>
<p dir="auto">pd.show_versions()</p>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 2.7.12.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 2.6.32-642.15.1.el6.x86_64<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.19.2<br>
nose: 1.3.7<br>
pip: 8.1.2<br>
setuptools: 27.2.0<br>
Cython: None<br>
numpy: 1.11.2<br>
scipy: 0.18.1<br>
statsmodels: 0.6.1<br>
xarray: None<br>
IPython: 5.1.0<br>
sphinx: 1.4.8<br>
patsy: 0.4.1<br>
dateutil: 2.4.1<br>
pytz: 2016.7<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
matplotlib: 1.5.1<br>
openpyxl: 2.4.0<br>
xlrd: 1.0.0<br>
xlwt: 1.1.2<br>
xlsxwriter: 0.9.3<br>
lxml: None<br>
bs4: None<br>
html5lib: None<br>
httplib2: None<br>
apiclient: None<br>
sqlalchemy: 1.1.2<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.8<br>
boto: None<br>
pandas_datareader: 0.2.1</p>
</details>
<h3 dir="auto">Summary</h3>
<p dir="auto">The question is what the sum of a Series of all NaNs should return (which is equivalent to an empty Series after skipping the NaNs): NaN or 0?</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: s = Series([np.nan])                 

In [2]: s.sum(skipna=True)  # skipping NaNs is the default
Out[2]: nan or 0     &lt;---- DISCUSSION POINT

In [3]: s.sum(skipna=False)
Out[3]: nan"><pre class="notranslate"><code class="notranslate">In [1]: s = Series([np.nan])                 

In [2]: s.sum(skipna=True)  # skipping NaNs is the default
Out[2]: nan or 0     &lt;---- DISCUSSION POINT

In [3]: s.sum(skipna=False)
Out[3]: nan
</code></pre></div>
<p dir="auto">The reason this is a discussion point has the following cause: the internal nansum implementation of pandas returns NaN. But, when bottleneck is installed, pandas will use bottlenecks implementation of nansum, which returns 0 (for the versions &gt;= 1.0).<br>
Bottleneck changed the behaviour from returning NaN to returning 0 to model it after numpy's nansum function.</p>
<p dir="auto">This has the very annoying consequence that depending on whether bottleneck is installed or not (which is only an optional dependency), you get a different behaviour.</p>
<p dir="auto">So the decision we need to make, is to either:</p>
<ul dir="auto">
<li>adapt pandas internal implementation to return 0, so in all cases 0 is returned for all NaN/empty series.</li>
<li>workaround bottlenecks behaviour or not use it for nansum, in order to consistently return NaN instead of 0</li>
<li>choose one of both above as the default, but have an option to switch behaviour</li>
</ul>
<hr>
<p dir="auto">Original title: <strong>nansum in bottleneck 1.0 will return 0 for all NaN arrays instead of NaN</strong></p>
<p dir="auto">xref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="56408343" data-permission-text="Title is private" data-url="https://github.com/pydata/bottleneck/issues/96" data-hovercard-type="issue" data-hovercard-url="/pydata/bottleneck/issues/96/hovercard" href="https://github.com/pydata/bottleneck/issues/96">pydata/bottleneck#96</a><br>
xref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="56703567" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/9421" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/9421/hovercard" href="https://github.com/pandas-dev/pandas/issues/9421">#9421</a></p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Tests are turned off for bottleneck &gt;1.0 (xref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="104823637" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/10986" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/10986/hovercard" href="https://github.com/pandas-dev/pandas/pull/10986">#10986</a>)</li>
</ul>
<p dir="auto">This matches a change from numpy 1.8 -&gt; 1.9.</p>
<p dir="auto">We should address this for pandas 0.16.</p>
<p dir="auto">Should we work around the new behavior (probably the simplest choice) or change nansum in pandas?</p>