# [Scipy-svn] r2205 - trunk/Lib/stats

scipy-svn at scipy.org scipy-svn at scipy.org
Tue Sep 19 19:04:06 CDT 2006

Author: oliphant
Date: 2006-09-19 19:04:02 -0500 (Tue, 19 Sep 2006)
New Revision: 2205

Modified:
trunk/Lib/stats/distributions.py
trunk/Lib/stats/stats.py
Log:
Fix-up SciPy

Modified: trunk/Lib/stats/distributions.py
===================================================================
--- trunk/Lib/stats/distributions.py	2006-09-19 23:41:55 UTC (rev 2204)
+++ trunk/Lib/stats/distributions.py	2006-09-20 00:04:02 UTC (rev 2205)
@@ -4166,7 +4166,8 @@
min = 0
U = random(size=size)
val = floor((max-min)*U + min)
-        return arr(val).astype(int)
+        return arr(val).astype(int)[()]  # return array scalar if needed
+
def _entropy(self, min, max):
return log(max-min)
randint = randint_gen(name='randint',longname='A discrete uniform '\

Modified: trunk/Lib/stats/stats.py
===================================================================
--- trunk/Lib/stats/stats.py	2006-09-19 23:41:55 UTC (rev 2204)
+++ trunk/Lib/stats/stats.py	2006-09-20 00:04:02 UTC (rev 2205)
@@ -194,7 +194,7 @@
import scipy as sp

# Grab this useful utility routine
-from numpy.core.numeric import _move_axis_to_0
+from numpy.core.numeric import rollaxis

import _support

@@ -430,7 +430,7 @@
"""
a, axis = _chk_asarray(a, axis)
if axis != 0:
-        a = _move_axis_to_0(a, axis)
+        a = rollaxis(a, axis, 0)
return np.median(a)

def mode(a, axis=0):