title: The difference between np.mean and pandas.mean
body: <pre><code>import numpy as np
  import pandas as pd
  import numpy.ma as ma
  
  a = np.zeros((2,3,2))
  a[0]=1
  a[1]=3
  
  a[0,0,1]=np.nan
  a[0,1,1]=np.nan
  a=ma.masked_invalid(a)
  a
  Out[17]: 
  masked_array(data =
   [[[1.0 --]
    [1.0 --]
    [1.0 1.0]]
  
   [[3.0 3.0]
    [3.0 3.0]
    [3.0 3.0]]],
               mask =
   [[[False  True]
    [False  True]
    [False False]]
  
   [[False False]
    [False False]
    [False False]]],
         fill_value = 1e+20)
  </code></pre>
  
  <p>I want to get the result using <code>np.mean</code> like the following:   </p>
  
  <pre><code>b = np.mean(a,axis=0)
  b
  
  Out[18]: 
  
  masked_array(data =
   [[2.0 3.0]
   [2.0 3.0]
   [2.0 2.0]],
               mask =
   [[False False]
   [False False]
   [False False]],
         fill_value = 1e+20)
  </code></pre>
  
  <p>It ignores <code>NaN</code> values and reserve the masked array, when computing the average of array along <code>axis=0</code>. </p>
  
  <p>But when I create a Panel using pandas and compute the average of the array: </p>
  
  <pre><code>p = pd.Panel(a)
  b1=p.mean(axis=0)
  b1.values
  Out[25]: 
  array([[ 2. ,  1.5],
         [ 2. ,  1.5],
         [ 2. ,  2. ]])
  </code></pre>
  
  <p>It seems that the mean method in pandas treats <code>NaN</code> values as zero and don't have masked array. </p>
  
  <p>My question is how to get the same result using pandas as using <code>np.mean</code>?  </p>