Re: [Numpy-discussion] index partition

2014-04-12 Thread Alexander Belopolsky
On Sat, Apr 12, 2014 at 5:03 PM, Sebastian Berg wrote: > > As a simple example, suppose for array `a` I want > > np.flatnonzero(a>0) and np.flatnonzero(a<=0). > > Can I get them both in one go? > > > > Might be missing something, but I don't think there is a way to do it in > one go. The result is

Re: [Numpy-discussion] index partition

2014-04-12 Thread Sebastian Berg
On Sa, 2014-04-12 at 16:47 -0400, Alan G Isaac wrote: > From a 1d array, I want two arrays of indexes: > the first for elements that satisfy a criterion, > and the second for elements that do not. Naturally > there are many ways to do this. Is there a preferred way? > > As a simple example, sup

Re: [Numpy-discussion] index partition

2014-04-12 Thread Alexander Belopolsky
On Sat, Apr 12, 2014 at 4:47 PM, Alan G Isaac wrote: > As a simple example, suppose for array `a` I want > np.flatnonzero(a>0) and np.flatnonzero(a<=0). > Can I get them both in one go? > I don't think you can do better than x = a > 0 p, q = np.flatnonzero(x), np.flatnonzero(~x) ___

[Numpy-discussion] index partition

2014-04-12 Thread Alan G Isaac
From a 1d array, I want two arrays of indexes: the first for elements that satisfy a criterion, and the second for elements that do not. Naturally there are many ways to do this. Is there a preferred way? As a simple example, suppose for array `a` I want np.flatnonzero(a>0) and np.flatnonzero(a

Re: [Numpy-discussion] Wiki page for building numerical stuff onWindows

2014-04-12 Thread Eelco Hoogendoorn
BLIS seems like a nice project as well. I like the arbitrary striding; BLAS lacking this has always annoyed me. -Original Message- From: "Sturla Molden" Sent: ‎12-‎4-‎2014 13:12 To: "numpy-discussion@scipy.org" Subject: Re: [Numpy-discussion] Wiki page for building numerical stuff onWin

Re: [Numpy-discussion] boolean operations on boolean arrays

2014-04-12 Thread Alexander Belopolsky
On Sat, Apr 12, 2014 at 10:02 AM, Alan G Isaac wrote: > Are there any considerations besides convenience in choosing > between: > > a&b a*b logical_and(a,b) > a|b a+b logical_or(a,b) > ~aTrue-a logical_not(a) > Boolean "-" is being deprecated:

Re: [Numpy-discussion] The BLAS problem

2014-04-12 Thread Dinesh Vadhia
Agree that OpenBLAS is the most favorable route instead of starting from scratch. Btw, why is sparse BLAS not included as I've always been under the impression that scipy sparse supports BLAS - no? ___ NumPy-Discussion mailing list NumPy-Discussion

Re: [Numpy-discussion] boolean operations on boolean arrays

2014-04-12 Thread Charles R Harris
On Sat, Apr 12, 2014 at 8:02 AM, Alan G Isaac wrote: > This is a very basic question. > Suppose `a` and `b` are boolean arrays with the same shape. > Are there any considerations besides convenience in choosing > between: > > a&b a*b logical_and(a,b) > a|b a+b

[Numpy-discussion] boolean operations on boolean arrays

2014-04-12 Thread Alan G Isaac
This is a very basic question. Suppose `a` and `b` are boolean arrays with the same shape. Are there any considerations besides convenience in choosing between: a&b a*b logical_and(a,b) a|b a+b logical_or(a,b) ~aTrue-a logical_not(a) I somewhat

Re: [Numpy-discussion] Wiki page for building numerical stuff on Windows

2014-04-12 Thread Sturla Molden
Eelco Hoogendoorn wrote: > I wonder: how hard would it be to create a more 21th-century oriented BLAS, > relying more on code generation tools, and perhaps LLVM/JITting? > > Wouldn't we get ten times the portability with one-tenth the lines of code? > Or is there too much dark magic going on in

Re: [Numpy-discussion] Wiki page for building numerical stuff on Windows

2014-04-12 Thread Eelco Hoogendoorn
I wonder: how hard would it be to create a more 21th-century oriented BLAS, relying more on code generation tools, and perhaps LLVM/JITting? Wouldn't we get ten times the portability with one-tenth the lines of code? Or is there too much dark magic going on in BLAS for such an approach to come clo