diff options
author | Travis Oliphant <oliphant@enthought.com> | 2005-10-20 07:07:53 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2005-10-20 07:07:53 +0000 |
commit | 8bc53bd09afa8be668fcd50f67542f2e21ce2d65 (patch) | |
tree | b721f7234c5780bcc26d135f6e60143a77f75f13 /scipy/base/numeric.py | |
parent | 143fa8c512e15c72c12301c05f263cb2e08b61b9 (diff) | |
download | numpy-8bc53bd09afa8be668fcd50f67542f2e21ce2d65.tar.gz |
Added .fill method.
Diffstat (limited to 'scipy/base/numeric.py')
-rw-r--r-- | scipy/base/numeric.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scipy/base/numeric.py b/scipy/base/numeric.py index 2e0ac1d35..f2009b8bf 100644 --- a/scipy/base/numeric.py +++ b/scipy/base/numeric.py @@ -248,9 +248,8 @@ def ones(shape, dtype=int_, fortran=0): """ones(shape, dtype=int_) returns an array of the given dimensions which is initialized to all ones. """ - a=zeros(shape, dtype, fortran) - a+=1 - ### a[...]=1 -- slower? + a = empty(shape, dtype, fortran) + a.fill(1) return a def identity(n,dtype=int_): |