def zscore(a, axis=0, ddof=0):
 a = np.asanyarray(a)
 mns = a.mean(axis=axis)
 sstd = a.std(axis=axis, ddof=ddof)
 if (axis and (mns.ndim < a.ndim)):
  return ((a - np.expand_dims(mns, axis=axis)) / np.expand_dims(sstd, axis=axis))
 else:
  return ((a - mns) / sstd)

def zscore ( a , axis = 0 , ddof = 0 ) : a = np . asanyarray ( a ) mns = a . mean ( axis = axis ) sstd = a . std ( axis = axis , ddof = ddof ) if ( axis and ( mns . ndim < a . ndim ) ) : return ( ( a - np . expand_dims ( mns , axis = axis ) ) / np . expand_dims ( sstd , axis = axis ) ) else : return ( ( a - mns ) / sstd )
calculates the z score of each value in the sample .