[Numpy-svn] r3045 - trunk/numpy/lib

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Aug 21 15:45:04 CDT 2006


Author: oliphant
Date: 2006-08-21 15:45:00 -0500 (Mon, 21 Aug 2006)
New Revision: 3045

Modified:
   trunk/numpy/lib/function_base.py
Log:
Re-factor fix to linspace

Modified: trunk/numpy/lib/function_base.py
===================================================================
--- trunk/numpy/lib/function_base.py	2006-08-21 19:55:37 UTC (rev 3044)
+++ trunk/numpy/lib/function_base.py	2006-08-21 20:45:00 UTC (rev 3045)
@@ -39,11 +39,11 @@
         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:



More information about the Numpy-svn mailing list