title: compute z-score with the function in scipy and numpy
body: <p>I try to use the stats.zscore() in scipy and have the following results which confuse me.</p>
  <p>Suppose I have an array and I compute the z-score in 2 different ways:</p>
  <pre><code>&gt;&gt;&gt; a = np.array([[1.0, 2.0], [3.0, 4.0]])
  &gt;&gt;&gt; a
  array([[ 1.,  2.],
         [ 3.,  4.]])
  </code></pre>
  <p>First result:</p>
  <pre><code>&gt;&gt;&gt; stats.zscore(a)               
  array([[-1., -1.],
         [ 1.,  1.]])
  </code></pre>
  <p>Second result:</p>
  <pre><code>&gt;&gt;&gt; mean = np.mean(a)
  &gt;&gt;&gt; mean
  2.5
  &gt;&gt;&gt; std = np.std(a)
  &gt;&gt;&gt; std
  1.1180339887498949
  &gt;&gt;&gt; b = (a-mean)/std
  &gt;&gt;&gt; b
  array([[-1.34164079, -0.4472136 ],
         [ 0.4472136 ,  1.34164079]])
  </code></pre>
  <p>The above results are different, but if I use another array,</p>
  <pre><code>&gt;&gt;&gt; c = np.array([ 0.7972,  0.0767,  0.4383,  0.7866,  0.8091,  0.1954, 0.6307, 0.6599,  0.1065,  0.0508])
  &gt;&gt;&gt; c
  array([ 0.7972,  0.0767,  0.4383,  0.7866,  0.8091,  0.1954,  0.6307, 0.6599,  0.1065,  0.0508])
  </code></pre>
  <p>First result:</p>
  <pre><code>&gt;&gt;&gt; stats.zscore(c)
  array([ 1.12724554, -1.2469956 , -0.05542642,  1.09231569,  1.16645923, -0.8558472 ,  0.57858329,  0.67480514, -1.14879659, -1.33234306])
  </code></pre>
  <p>Second result:</p>
  <pre><code>&gt;&gt;&gt; mean = np.mean(c)
  &gt;&gt;&gt; mean
  0.45511999999999986
  &gt;&gt;&gt; std = np.std(c)
  &gt;&gt;&gt; std
  0.30346538451691657
  &gt;&gt;&gt; b = (c-mean)/std
  &gt;&gt;&gt; b
  array([ 1.12724554, -1.2469956 , -0.05542642,  1.09231569,  1.16645923, -0.8558472 ,  0.57858329,  0.67480514, -1.14879659, -1.33234306])
  
      
  </code></pre>
  <p>So when I use another array, the results become the same. Can someone help me understand what I did wrong in this? Thanks!</p>