summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-06-02 22:12:58 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-06-02 22:12:58 +0000
commit252b09d263678204ee5c30722dd5664cb5279d1a (patch)
tree728de3613bd6e63834393c34a914b13d609c3253
parent241a113911649a7f43b4f1a2b99ca49ecd7e709a (diff)
downloadnumpy-252b09d263678204ee5c30722dd5664cb5279d1a.tar.gz
Change rand and randn back to not take tuple argument. Alter docstring to alert user what function to use to pass in a tuple.
-rw-r--r--numpy/random/mtrand/mtrand.pyx13
1 files changed, 9 insertions, 4 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx
index 137cf83e1..b01055d83 100644
--- a/numpy/random/mtrand/mtrand.pyx
+++ b/numpy/random/mtrand/mtrand.pyx
@@ -427,11 +427,14 @@ cdef class RandomState:
random numbers from a uniform distribution in the range [0,1).
rand(d0, d1, ..., dn) -> random values
+
+ Note: This is a convenience function. If you want an
+ interface that takes a tuple as the first argument
+ use numpy.random.random_sample(shape_tuple).
+
"""
if len(args) == 0:
return self.random_sample()
- elif isinstance(args[0], tuple):
- return self.random_sample(size=args[0])
else:
return self.random_sample(size=args)
@@ -440,11 +443,13 @@ cdef class RandomState:
array of shape (d0, d1, ..., dn).
randn(d0, d1, ..., dn) -> random values
+
+ Note: This is a convenience function. If you want an
+ interface that takes a tuple as the first argument
+ use numpy.random.standard_normal(shape_tuple).
"""
if len(args) == 0:
return self.standard_normal()
- elif isinstance(args[0], tuple):
- return self.standard_normal(args[0])
else:
return self.standard_normal(args)