summaryrefslogtreecommitdiff
path: root/scipy/base/numeric.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-10-20 07:07:53 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-10-20 07:07:53 +0000
commit8bc53bd09afa8be668fcd50f67542f2e21ce2d65 (patch)
treeb721f7234c5780bcc26d135f6e60143a77f75f13 /scipy/base/numeric.py
parent143fa8c512e15c72c12301c05f263cb2e08b61b9 (diff)
downloadnumpy-8bc53bd09afa8be668fcd50f67542f2e21ce2d65.tar.gz
Added .fill method.
Diffstat (limited to 'scipy/base/numeric.py')
-rw-r--r--scipy/base/numeric.py5
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_):