title: mean, nanmean and warning: Mean of empty slice
body: <p>Say I construct two numpy arrays:</p>
  
  <pre><code>a = np.array([np.NaN, np.NaN])
  b = np.array([np.NaN, np.NaN, 3])
  </code></pre>
  
  <p>Now I find that <code>np.mean</code> returns <code>nan</code> for both <code>a</code> and <code>b</code>:</p>
  
  <pre><code>&gt;&gt;&gt; np.mean(a)
  nan
  &gt;&gt;&gt; np.mean(b)
  nan
  </code></pre>
  
  <p>Since numpy 1.8 (released 20 April 2016), we've been blessed with <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.nanmean.html" rel="noreferrer">nanmean</a>, which ignores <code>nan</code> values:</p>
  
  <pre><code>&gt;&gt;&gt; np.nanmean(b)
  3.0
  </code></pre>
  
  <p>However, when the array has nothing <strong>but</strong> <code>nan</code> values, it raises a warning:</p>
  
  <pre><code>&gt;&gt;&gt; np.nanmean(a)
  nan
  C:\python-3.4.3\lib\site-packages\numpy\lib\nanfunctions.py:598: RuntimeWarning: Mean of empty slice
    warnings.warn("Mean of empty slice", RuntimeWarning)
  </code></pre>
  
  <p>I don't like suppressing warnings; is there a better function I can use to get the behaviour of <code>nanmean</code> without that warning?</p>