[Scipy-svn] r2029 - trunk/Lib/stats

scipy-svn at scipy.org scipy-svn at scipy.org
Fri Jun 30 04:30:07 EDT 2006


Author: stefan
Date: 2006-06-30 03:30:00 -0500 (Fri, 30 Jun 2006)
New Revision: 2029

Modified:
   trunk/Lib/stats/stats.py
Log:
Speed up zs.


Modified: trunk/Lib/stats/stats.py
===================================================================
--- trunk/Lib/stats/stats.py	2006-06-29 10:12:51 UTC (rev 2028)
+++ trunk/Lib/stats/stats.py	2006-06-30 08:30:00 UTC (rev 2029)
@@ -1188,12 +1188,10 @@
 computed relative to the passed array.
 
 """
-    zscores = []
-    for item in a:
-        zscores.append(z(a,item))
-    return array(zscores)
+    mu = mean(a,None)
+    sigma = samplestd(a)
+    return (array(a)-mu)/sigma
 
-
 def zmap(scores, compare, axis=0):
     """
 Returns an array of z-scores the shape of scores (e.g., [x,y]), compared to




More information about the Scipy-svn mailing list