title: Calculating standard deviation on list ignoring zeros using numpy
body: <p>I am having a list <code>pct_change</code>. I need to calculate std deviation on the list ignoring the zeros. I tried below code, but it is not working as expected.</p>
  
  <pre><code>import numpy as np
  m = np.ma.masked_equal(pct_change, 0)
  value = m.mask.std()
  </code></pre>
  
  <p>Input value: <code>pct_change</code></p>
  
  <pre><code>0          0.00
  1          0.00
  2          0.00
  3      18523.94
  4      15501.94
  5      14437.03
  6      13402.43
  7      18986.14
  </code></pre>
  
  <p>Code has to ignore 3 zero values and then calculate standard deviation. </p>