diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-03-01 06:10:17 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-03-01 06:10:17 +0000 |
commit | 3f8c2dea68dd5d8b437a02f002836f09644e5c3f (patch) | |
tree | b77d3891d3073ef84d214d11f17f605633e16c3e /numpy/core/numeric.py | |
parent | 5f9949015822c662a8a5bd145f2aab08c2b3dfb2 (diff) | |
download | numpy-3f8c2dea68dd5d8b437a02f002836f09644e5c3f.tar.gz |
Swap order of fill-function arguments and make ones use fill now.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 1da30e68f..d4359a540 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -340,11 +340,11 @@ def ones(shape, dtype=int_, fortran=False): """ones(shape, dtype=int_) returns an array of the given dimensions which is initialized to all ones. """ - # This appears to be slower... - #a = empty(shape, dtype, fortran) - #a.fill(1) - a = zeros(shape, dtype, fortran) - a+=1 + a = empty(shape, dtype, fortran) + a.fill(1) + # Above is faster now after addition of fast loops. + #a = zeros(shape, dtype, fortran) + #a+=1 return a def identity(n,dtype=int_): |