Read about our upcoming Code of Conduct on this issue

Commit 6d153b47 authored by Brian Kearns's avatar Brian Kearns
Browse files

some optimizations for arange

parent aab89610d3d8
...@@ -16,9 +16,9 @@ def arange(start, stop=None, step=1, dtype=None): ...@@ -16,9 +16,9 @@ def arange(start, stop=None, step=1, dtype=None):
dtype = test.dtype dtype = test.dtype
length = math.ceil((float(stop) - start) / step) length = math.ceil((float(stop) - start) / step)
length = int(length) length = int(length)
arr = _numpypy.multiarray.zeros(length, dtype=dtype) arr = _numpypy.multiarray.empty(length, dtype=dtype)
i = start i = start
for j in range(arr.size): for j in xrange(arr.size):
arr[j] = i arr[j] = i
i += step i += step
return arr return arr
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment