[Numpy-discussion] (a and b) != (b and a) ?

Reggie Dugard reggie at merfinllc.com
Wed Jun 12 11:56:05 CDT 2002


This is not, in fact, a bug although I've fallen prey to the same
mistake myself.  I'm assuming what you really wanted was to use
logical_and:

Python 2.2.1 (#1, Apr 29 2002, 15:21:53) 
[GCC 3.0.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Numeric import *
>>> a = array((1,1), 'b')
>>> b = array((1,0), 'b')
>>> logical_and(a,b)
array([1, 0],'b')
>>> logical_and(b,a)
array([1, 0],'b')
>>> 



More information about the Numpy-discussion mailing list