title: Pandas dataframe - remove outliers
body: <p>Given a pandas dataframe, I want to exclude rows corresponding to outliers (Z-value = 3) based on one of the columns.</p>
  
  <p>The dataframe looks like this:</p>
  
  <pre><code>df.dtypes
  _id                   object
  _index                object
  _score                object
  _source.address       object
  _source.district      object
  _source.price        float64
  _source.roomCount    float64
  _source.size         float64
  _type                 object
  sort                  object
  priceSquareMeter     float64
  dtype: object
  </code></pre>
  
  <p>For the line:</p>
  
  <pre><code>dff=df[(np.abs(stats.zscore(df)) &lt; 3).all(axis='_source.price')]
  </code></pre>
  
  <p>The following exception is raised:</p>
  
  <pre><code>-------------------------------------------------------------------------    
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-68-02fb15620e33&gt; in &lt;module&gt;()
  ----&gt; 1 dff=df[(np.abs(stats.zscore(df)) &lt; 3).all(axis='_source.price')]
  
  /opt/anaconda3/lib/python3.6/site-packages/scipy/stats/stats.py in zscore(a, axis, ddof)
     2239     """
     2240     a = np.asanyarray(a)
  -&gt; 2241     mns = a.mean(axis=axis)
     2242     sstd = a.std(axis=axis, ddof=ddof)
     2243     if axis and mns.ndim &lt; a.ndim:
  
  /opt/anaconda3/lib/python3.6/site-packages/numpy/core/_methods.py in _mean(a, axis, dtype, out, keepdims)
       68             is_float16_result = True
       69 
  ---&gt; 70     ret = umr_sum(arr, axis, dtype, out, keepdims)
       71     if isinstance(ret, mu.ndarray):
       72         ret = um.true_divide(
  
  TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
  </code></pre>
  
  <p>And the return value of</p>
  
  <pre><code>np.isreal(df['_source.price']).all()
  </code></pre>
  
  <p>is</p>
  
  <pre><code>True
  </code></pre>
  
  <p>Why do I get the above exception, and how can I exclude the outliers?</p>