summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-08-21 20:45:00 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-08-21 20:45:00 +0000
commit38fb6d0ed7881d4e4c28d242f9017e500cf34f20 (patch)
treede55c69337197d34c34b4282a06c91e5da9fc1b5 /numpy/lib/function_base.py
parent973779460434e0a26e0f0e5c7dd566cf6a47c5c5 (diff)
downloadnumpy-38fb6d0ed7881d4e4c28d242f9017e500cf34f20.tar.gz
Re-factor fix to linspace
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 0753f18f7..172dddfea 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -39,11 +39,11 @@ def linspace(start, stop, num=50, endpoint=True, retstep=False):
if num == 1:
return array([float(start)])
step = (stop-start)/float((num-1))
+ y = _nx.arange(0, num) * step + start
+ y[-1] = stop
else:
step = (stop-start)/float(num)
- y = _nx.arange(0, num) * step + start
- if endpoint:
- y[-1] = stop
+ y = _nx.arange(0, num) * step + start
if retstep:
return y, step
else: