title: How to apply a function on a subset of numpy.ndarray object
body: <p>I have a <code>numpy.ndarray</code> object of size <code>10000 x 20</code> and what I would like to do is simply to apply function <code>scipy.stats.mstats.zscore</code> on per row basis but without considering the non negative values. Any ideas?</p>
  
  <pre><code># this works when considering all values
  z_scores = st.mstats.zscore(data, axis=1, ddof=1)
  
  # apparently, this does not work
  z_scores = st.mstats.zscore(data[data&gt;0], axis=1, ddof=1)
  </code></pre>