def zmap(scores, compare, axis=0, ddof=0):
 (scores, compare) = map(np.asanyarray, [scores, compare])
 mns = compare.mean(axis=axis)
 sstd = compare.std(axis=axis, ddof=ddof)
 if (axis and (mns.ndim < compare.ndim)):
  return ((scores - np.expand_dims(mns, axis=axis)) / np.expand_dims(sstd, axis=axis))
 else:
  return ((scores - mns) / sstd)

def zmap ( scores , compare , axis = 0 , ddof = 0 ) : ( scores , compare ) = map ( np . asanyarray , [ scores , compare ] ) mns = compare . mean ( axis = axis ) sstd = compare . std ( axis = axis , ddof = ddof ) if ( axis and ( mns . ndim < compare . ndim ) ) : return ( ( scores - np . expand_dims ( mns , axis = axis ) ) / np . expand_dims ( sstd , axis = axis ) ) else : return ( ( scores - mns ) / sstd )
calculates the relative z-scores .