summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py10
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_):