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

numpy-svn@scip... numpy-svn@scip...
Wed Feb 20 16:04:54 CST 2008


Author: rkern
Date: 2008-02-20 16:04:52 -0600 (Wed, 20 Feb 2008)
New Revision: 4815

Modified:
   trunk/numpy/lib/function_base.py
Log:
Use x.any() instead of any(x)

Modified: trunk/numpy/lib/function_base.py
===================================================================
--- trunk/numpy/lib/function_base.py	2008-02-20 09:07:45 UTC (rev 4814)
+++ trunk/numpy/lib/function_base.py	2008-02-20 22:04:52 UTC (rev 4815)
@@ -15,7 +15,7 @@
 import types
 import numpy.core.numeric as _nx
 from numpy.core.numeric import ones, zeros, arange, concatenate, array, \
-     asarray, asanyarray, empty, empty_like, asanyarray, ndarray, around
+     asarray, asanyarray, empty, empty_like, ndarray, around
 from numpy.core.numeric import ScalarType, dot, where, newaxis, intp, \
      integer, isscalar
 from numpy.core.umath import pi, multiply, add, arctan2,  \
@@ -152,7 +152,7 @@
         bins = linspace(mn, mx, bins, endpoint=False)
     else:
         bins = asarray(bins)
-        if(any(bins[1:]-bins[:-1] < 0)):
+        if (bins[1:]-bins[:-1] < 0).any():
             raise AttributeError, 'bins must increase monotonically.'
 
     # best block size probably depends on processor cache size



More information about the Numpy-svn mailing list