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

2012-03-25 Thread Pierre Haessig
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 =

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

2012-03-25 Thread Eric Firing
On 03/25/2012 06:55 AM, Pierre Haessig wrote: 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

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

2012-03-25 Thread Pierre Haessig
Hi Eric, Thanks for the hints ! Le 25/03/2012 20:33, Eric Firing a écrit : Using the bitwise operators in place of logical operators is a hack to get around limitations of the language; but, if done carefully, it is a useful one. What is the rationale behind not overloading __and__ other

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

2012-03-25 Thread Eric Firing
On 03/25/2012 12:22 PM, Pierre Haessig wrote: Hi Eric, Thanks for the hints ! Le 25/03/2012 20:33, Eric Firing a écrit : Using the bitwise operators in place of logical operators is a hack to get around limitations of the language; but, if done carefully, it is a useful one. What is the

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

2012-03-20 Thread Matthieu Rigal
Mar 2012 13:20:23 + From: Richard Hattersley rhatters...@gmail.com Subject: Re: [Numpy-discussion] Using logical function on more than 2 arrays, availability of a between function ? To: Discussion of Numerical Python numpy-discussion@scipy.org Message-ID: CAP=RS9

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

2012-03-20 Thread Frédéric Bastien
Hattersley rhatters...@gmail.com Subject: Re: [Numpy-discussion] Using logical function on more than 2         arrays, availability of a between function ? To: Discussion of Numerical Python numpy-discussion@scipy.org Message-ID: CAP=RS9=UBOc6Kmtmnne7W093t19w=T=osrxuaw0wf8b49hq...@mail.gmail.com

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

2012-03-19 Thread Matthieu Rigal
Dear Numpy fellows, I have actually a double question, which only aims to answer a single one : how to get the following line being processed more efficiently : array = numpy.logical_and(numpy.logical_and(aBlueChannel 1.0, aNirChannel (aBlueChannel * 1.0)), aNirChannel (aBlueChannel * 1.8))

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

2012-03-19 Thread Richard Hattersley
What do you mean by efficient? Are you trying to get it execute faster? Or using less memory? Or have more concise source code? Less memory: - numpy.vectorize would let you get to the end result without any intermediate arrays but will be slow. - Using the out parameter of numpy.logical_and