[SciPy-user] comparing two lists/arrays

nicky van foreest vanforeest@gmail....
Wed Jul 15 07:29:48 CDT 2009


Given two vectors x and y, the (perhaps) common mathematical
definition of x < y is that x_i < y_i for all i.  Thus, the
mathematical comparison x <y returns just one boolean, not an array of
booleans for each x_i < y_i.  I implemented this behavior as
prod(less(X,Y)) (I use less to be able to deal with lists X and Y
also). Is there perhaps a more straighforward/elegant/readible way to
achieve the same behavior?



More information about the SciPy-user mailing list