[Numpy-discussion] Using logical function on more than 2 arrays, availability of a "between" function ?

Pierre Haessig pierre.haessig@crans....
Sun Mar 25 11:55:02 CDT 2012


Hi,

I have an off topic but somehow related question :

Le 19/03/2012 12:04, Matthieu Rigal a écrit :
> array = numpy.logical_and(numpy.logical_and(aBlueChannel < 1.0, aNirChannel > 
> (aBlueChannel * 1.0)), aNirChannel < (aBlueChannel * 1.8))
Is there any significant difference between :

z = np.logical_and(x,y) and
z= x & y (assuming x and y are already numpy arrays and not just list)

I've always used the & (and | and ~) operator because it's of course
much shorter ;-)

I've seen no mention of the "&" operator in np.logical_and docstring so
I wonder...

Best,
Pierre

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120325/41308ed3/attachment.bin 


More information about the NumPy-Discussion mailing list