diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-07-12 19:04:25 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-07-12 19:04:25 +0000 |
commit | 1a9ba98fb2f0aa0475d12d3f8007e851525ccb30 (patch) | |
tree | e9c7af3637c69e46b8be412109a01859253be078 /numpy/matlib.py | |
parent | 3e05403c03182b51d8fecd8b478b44bc7b1f65d9 (diff) | |
download | numpy-1a9ba98fb2f0aa0475d12d3f8007e851525ccb30.tar.gz |
Keep rand and randn in matlib and make them take tuples as well as individual arguments.
Diffstat (limited to 'numpy/matlib.py')
-rw-r--r-- | numpy/matlib.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/numpy/matlib.py b/numpy/matlib.py index 9fd3cc6e1..2923fe352 100644 --- a/numpy/matlib.py +++ b/numpy/matlib.py @@ -1,8 +1,12 @@ -__all__ = ['ones','zeros','empty','identity','rand','randn','eye'] - from numpy.core.defmatrix import matrix, asmatrix from numpy import ndarray, array import numpy as N +from numpy import * + +__version__ = N.__version__ + +__all__ = N.__all__ +__all__ += ['rand', 'randn'] def empty(shape, dtype=None, order='C'): """return an empty matrix of the given shape @@ -35,7 +39,11 @@ def eye(n,M=None, k=0, dtype=float): return asmatrix(N.eye(n,M,k,dtype)) def rand(*args): + if isinstance(args[0], tuple): + args = args[0] return asmatrix(N.random.rand(*args)) def randn(*args): + if isinstance(args[0], tuple): + args = args[0] return asmatrix(N.random.rand(*args)) |