Re: [Numpy-discussion] setmember1d_nu

2009-06-04 Thread Robert Cimrman
Hi Neil, Neil Crighton wrote: Hi all, I posted this message couple of days ago, but gmane grouped it with an old thread and it hasn't shown up on the front page. So here it is again... I'd really like to see the setmember1d_nu function in ticket 1036 get into numpy. There's a patch

Re: [Numpy-discussion] Problem with correlate

2009-06-04 Thread David Cournapeau
On Tue, Jun 2, 2009 at 10:56 PM, Ryan May rma...@gmail.com wrote: On Tue, Jun 2, 2009 at 5:59 AM, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: Robin wrote: On Tue, Jun 2, 2009 at 11:36 AM, David Cournapeau courn...@gmail.com wrote: Done in r7031 - correlate/PyArray_Correlate

[Numpy-discussion] Scipy 0.7.1rc1 released

2009-06-04 Thread David Cournapeau
Hi, The RC1 for 0.7.1 scipy release has just been tagged. This is a bug-only release, see below for the release notes. More information can also be found on the trac website: http://projects.scipy.org/scipy/milestone/0.7.1 Please test it ! The scipy developers -- =

Re: [Numpy-discussion] [RFR] NpzFile tweaks (Re: Making NpzFiles behave more like dictionaries.)

2009-06-04 Thread David Warde-Farley
On 3-Jun-09, at 5:01 PM, Pauli Virtanen wrote: Btw, are you able to change the status of the ticket to needs_review? I think this should be possible for everyone, and not restricted to admins, but I'm not 100% sure... Sorry Pauli, seems I _don't_ have permission on the numpy trac to

[Numpy-discussion] BigInteger equivalent in numpy

2009-06-04 Thread wierob
Hi, is there a BigInteger equivalent in numpy? The largest integer type I wound was dtype int64. I'm using stats.linregress to perform a regression analysis. The return stderr was nan because stas.ss(...) returned a negative number due to an overflow. Setting dtype to int64 for my input data

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Alan G Isaac
a[(a==b[:,None]).sum(axis=0,dtype=bool)] hth, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread josef . pktd
On Thu, Jun 4, 2009 at 8:23 AM, Alan G Isaac ais...@american.edu wrote: a[(a==b[:,None]).sum(axis=0,dtype=bool)] this is my preferred way when b is small and has unique elements. if the elements in b are not unique, then be can be replaced by np.unique(b) If b is large this creates a huge

Re: [Numpy-discussion] BigInteger equivalent in numpy

2009-06-04 Thread josef . pktd
On Thu, Jun 4, 2009 at 8:19 AM, wierob wiero...@googlemail.com wrote: Hi, is there a BigInteger equivalent in numpy? The largest integer type I wound was dtype int64. I'm using stats.linregress to perform a regression analysis. The return stderr was nan because stas.ss(...) returned a

Re: [Numpy-discussion] [RFR] NpzFile tweaks (Re: Making NpzFiles behave more like dictionaries.)

2009-06-04 Thread Stéfan van der Walt
2009/6/4 David Warde-Farley d...@cs.toronto.edu: Sorry Pauli, seems I _don't_ have permission on the numpy trac to change ticket status. The radio button shows up but then it gives me a Warning: No permission to change ticket fields. Should be fixed. Cheers Stéfan

[Numpy-discussion] performance matrix multiplication vs. matlab

2009-06-04 Thread David Paul Reichert
Hi all, I would be glad if someone could help me with the following issue: From what I've read on the web it appears to me that numpy should be about as fast as matlab. However, when I do simple matrix multiplication, it consistently appears to be about 5 times slower. I tested this using A =

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2009-06-04 Thread Sebastian Walter
Have a look at this thread: http://www.mail-archive.com/numpy-discussion@scipy.org/msg13085.html The speed difference is probably due to the fact that the matrix multiplication does not call optimized an optimized blas routine, e.g. the ATLAS blas. Sebastian On Thu, Jun 4, 2009 at 3:36 PM,

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Alan G Isaac
On Thu, Jun 4, 2009 at 8:23 AM, Alan G Isaac ais...@american.edu wrote: a[(a==b[:,None]).sum(axis=0,dtype=bool)] On 6/4/2009 8:35 AM josef.p...@gmail.com apparently wrote: If b is large this creates a huge intermediate array True enough, but one could then use fromiter: setb = set(b) itr =

Re: [Numpy-discussion] Problem with correlate

2009-06-04 Thread Ryan May
On Thu, Jun 4, 2009 at 5:14 AM, David Cournapeau courn...@gmail.com wrote: On Tue, Jun 2, 2009 at 10:56 PM, Ryan May rma...@gmail.com wrote: On Tue, Jun 2, 2009 at 5:59 AM, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: Robin wrote: On Tue, Jun 2, 2009 at 11:36 AM, David

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread josef . pktd
On Thu, Jun 4, 2009 at 10:13 AM, Alan G Isaac ais...@american.edu wrote: On Thu, Jun 4, 2009 at 8:23 AM, Alan G Isaac ais...@american.edu wrote: a[(a==b[:,None]).sum(axis=0,dtype=bool)] On 6/4/2009 8:35 AM josef.p...@gmail.com apparently wrote: If b is large this creates a huge intermediate

Re: [Numpy-discussion] matrix default to column vector?

2009-06-04 Thread Jason Rennie
Thanks for the responses. I did not realize that dot() would do matrix multiplication which was the main reason I was looking for a matrix-like class. Like you and Tom suggested, I think it's best to stick to arrays. Cheers, Jason On Sun, May 24, 2009 at 6:45 PM, David Warde-Farley

Re: [Numpy-discussion] Scipy 0.7.1rc1 released

2009-06-04 Thread Matthew Brett
Hi,    The RC1 for 0.7.1 scipy release has just been tagged. This is a bug-only release I feel (y)our pain, but don't you mean 'bug-fix only release'? ;-) Matthew ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Alan G Isaac
On Thu, Jun 4, 2009 at 10:13 AM, Alan G Isaac ais...@american.edu wrote: Or if a stable order is not important (I don't recall if the OP specified), one could just np.intersect1d(a, np.unique(b)) On 6/4/2009 10:50 AM josef.p...@gmail.com apparently wrote: This requires that also `a` has only

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread josef . pktd
On Thu, Jun 4, 2009 at 11:12 AM, Alan G Isaac ais...@american.edu wrote: On Thu, Jun 4, 2009 at 10:13 AM, Alan G Isaac ais...@american.edu wrote: Or if a stable order is not important (I don't recall if the OP specified), one could just np.intersect1d(a, np.unique(b)) On 6/4/2009 10:50 AM

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Alan G Isaac
On 6/4/2009 10:50 AM josef.p...@gmail.com apparently wrote: intersect1d gives set intersection if both arrays have only unique elements (i.e. are sets). I thought the naming is pretty clear: intersect1d(a,b) set intersection if a and b with unique elements intersect1d_nu(a,b) set

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Robert Cimrman
Alan G Isaac wrote: On 6/4/2009 10:50 AM josef.p...@gmail.com apparently wrote: intersect1d gives set intersection if both arrays have only unique elements (i.e. are sets). I thought the naming is pretty clear: intersect1d(a,b) set intersection if a and b with unique elements

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread josef . pktd
On Thu, Jun 4, 2009 at 11:19 AM, Alan G Isaac ais...@american.edu wrote: On 6/4/2009 10:50 AM josef.p...@gmail.com apparently wrote: intersect1d gives set intersection if both arrays have only unique elements (i.e. are sets).  I thought the naming is pretty clear: intersect1d(a,b)   set

[Numpy-discussion] Calculations with mixed type structured arrays

2009-06-04 Thread josef . pktd
After yesterdays discussion, I wanted to see if views of structured arrays with mixed type can be easily used. Is the following useful for the numpy user guide? Josef Calculations with mixed type structured arrays -- import numpy as np The

Re: [Numpy-discussion] Scipy 0.7.1rc1 released

2009-06-04 Thread Stéfan van der Walt
2009/6/4 Matthew Brett matthew.br...@gmail.com:    The RC1 for 0.7.1 scipy release has just been tagged. This is a bug-only release I feel (y)our pain, but don't you mean 'bug-fix only release'? ;-) Thanks, guys! You made my weekend :-) Cheers Stéfan

Re: [Numpy-discussion] [RFR] NpzFile tweaks (Re: Making NpzFiles behave more like dictionaries.)

2009-06-04 Thread David Warde-Farley
On 4-Jun-09, at 9:28 AM, Stéfan van der Walt wrote: 2009/6/4 David Warde-Farley d...@cs.toronto.edu: Sorry Pauli, seems I _don't_ have permission on the numpy trac to change ticket status. The radio button shows up but then it gives me a Warning: No permission to change ticket fields.

Re: [Numpy-discussion] matrix default to column vector?

2009-06-04 Thread Keith Goodman
On Sun, May 24, 2009 at 3:45 PM, David Warde-Farley d...@cs.toronto.edu wrote: Anecdotally, it seems to me that lots of people (myself included) seem to go through a phase early in their use of NumPy where they try to use matrix(), but most seem to end up switching to using 2D arrays for all

Re: [Numpy-discussion] matrix default to column vector?

2009-06-04 Thread Alan G Isaac
On Sun, May 24, 2009 at 3:45 PM, David Warde-Farley d...@cs.toronto.edu wrote: Anecdotally, it seems to me that lots of people (myself included) seem to go through a phase early in their use of NumPy where they try to use matrix(), but most seem to end up switching to using 2D arrays for

Re: [Numpy-discussion] matrix default to column vector?

2009-06-04 Thread Olivier Verdier
I really don't see any advantage of matrices over arrays for teaching. I prefer to teach linear algebra with arrays. I would also like matrices to disappear from numpy. But then one would need a new implementation of scipy.sparse, which is (very unfortunately) matrix-based at the moment. ==

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Alan G Isaac
On 6/4/2009 11:29 AM josef.p...@gmail.com apparently wrote: intersect1d is the intersection between sets (which are stored as arrays), just like in the mathematical definition the two sets only have unique elements Hmmm. OK, I see you and Robert believe this. But it does not match the

Re: [Numpy-discussion] matrix default to column vector?

2009-06-04 Thread Alan G Isaac
On 6/4/2009 12:08 PM Olivier Verdier apparently wrote: I really don't see any advantage of matrices over arrays for teaching. I prefer to teach linear algebra with arrays. beta = (X.T*X).I * X.T * Y beta = np.dot(np.dot(la.inv(np.dot(X.T,X)),X.T),Y) I rest my case. I would have to switch

[Numpy-discussion] Speaking of fft code

2009-06-04 Thread Neal Becker
Has this been considered as a candidate for our fft? http://sourceforge.net/projects/kissfft ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread josef . pktd
On Thu, Jun 4, 2009 at 12:32 PM, Alan G Isaac ais...@american.edu wrote: On 6/4/2009 11:29 AM josef.p...@gmail.com apparently wrote: intersect1d  is the intersection between sets (which are stored as arrays), just like in the mathematical definition the two sets only have unique elements

Re: [Numpy-discussion] Speaking of fft code

2009-06-04 Thread Robert Kern
On Thu, Jun 4, 2009 at 11:58, Neal Becker ndbeck...@gmail.com wrote: Has this been considered as a candidate for our fft? http://sourceforge.net/projects/kissfft No. What would be the advantage of moving to Kiss FFT to offset the cost? -- Robert Kern I have come to believe that the whole

Re: [Numpy-discussion] ANNOUNCE: ETS 3.2.0 Released

2009-06-04 Thread Ariel Rokem
Hi - thanks for all the good work on this! I have been using an older version of the ETS, which I got when I installed the EPD (4.0.30001) and now I have finally gotten around to trying to update my ETS to this version. I have a question - how do I go about uninstalling my previous version of

Re: [Numpy-discussion] Speaking of fft code

2009-06-04 Thread Neal Becker
Robert Kern wrote: On Thu, Jun 4, 2009 at 11:58, Neal Becker ndbeck...@gmail.com wrote: Has this been considered as a candidate for our fft? http://sourceforge.net/projects/kissfft No. What would be the advantage of moving to Kiss FFT to offset the cost? I was reading this:

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Alan G Isaac
On 6/4/2009 1:27 PM josef.p...@gmail.com apparently wrote: Note: there are two versions of the docs for np.intersect1d, the currently published docs which describe the actual behavior (for the non-unique case), and the new docs on the doc editor

Re: [Numpy-discussion] field names on numpy arrays

2009-06-04 Thread Fernando Perez
Howdy, 2009/6/3 Stéfan van der Walt ste...@sun.ac.za: however i seem to lose simple operations such as multiplication (a_array*2) or powers (a_array**2). As a workaround, you can have two views on your data: I was thinking about this yesterday, because I'm dealing with exactly this same

Re: [Numpy-discussion] Speaking of fft code

2009-06-04 Thread Robert Kern
On Thu, Jun 4, 2009 at 13:30, Neal Becker ndbeck...@gmail.com wrote: Robert Kern wrote: On Thu, Jun 4, 2009 at 11:58, Neal Becker ndbeck...@gmail.com wrote: Has this been considered as a candidate for our fft? http://sourceforge.net/projects/kissfft No. What would be the advantage of

Re: [Numpy-discussion] field names on numpy arrays

2009-06-04 Thread Pierre GM
On Jun 4, 2009, at 3:12 PM, Fernando Perez wrote: Howdy, I was thinking about this yesterday, because I'm dealing with exactly this same problem in a local project. How hard would it be to allow structured arrays to support ufuncs/arithmetic for the case where their dtype is actually a

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread josef . pktd
On Thu, Jun 4, 2009 at 2:58 PM, Alan G Isaac ais...@american.edu wrote: On 6/4/2009 1:27 PM josef.p...@gmail.com apparently wrote: Note: there are two versions of the docs for np.intersect1d, the currently published docs which describe the actual behavior (for the non-unique case), and the new

Re: [Numpy-discussion] ANNOUNCE: ETS 3.2.0 Released

2009-06-04 Thread Gael Varoquaux
On Thu, Jun 04, 2009 at 11:03:36AM -0700, Ariel Rokem wrote: I have a question - how do I go about uninstalling my previous version of the ETS? A more general question to anyone - what's the right way of uninstalling any old python package? In the past, I have been advised to go in

Re: [Numpy-discussion] Scipy 0.7.1rc1 released

2009-06-04 Thread Pauli Virtanen
Thu, 04 Jun 2009 19:24:32 +0900, David Cournapeau wrote: [clip] = SciPy 0.7.1 Release Notes = .. contents:: SciPy 0.7.1 is a bug-fix release with no new features compared to 0.7.0. scipy.special = Several bugs of varying

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Kim Hansen
Concerning the name setmember1d_nu, I personally find it quite verbose and not the name I would expect as a non-insider coming to numpy and not knowing all the names of the more special hidden-away functions and not being a python-wiz either. I think ain(a,b) would be the name I had expected as

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Gael Varoquaux
On Thu, Jun 04, 2009 at 10:27:11PM +0200, Kim Hansen wrote: in(b) or in_iterable(b) method, such that you could do a.in(b) which would return a boolean array of the same shape as a with elements true if the equivalent a members were members in the iterable b. That would really by what I would

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Anne Archibald
2009/6/4 josef.p...@gmail.com: intersect1d should throw a domain error if you give it arrays with non-unique elements, which is not done for speed reasons It seems to me that this is the basic source of the problem. Perhaps this can be addressed? I realize maintaining compatibility with the

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread josef . pktd
On Thu, Jun 4, 2009 at 4:30 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Thu, Jun 04, 2009 at 10:27:11PM +0200, Kim Hansen wrote: in(b) or in_iterable(b) method, such that you could do a.in(b) which would return a boolean array of the same shape as a with elements true if the

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Gael Varoquaux
On Thu, Jun 04, 2009 at 04:43:39PM -0400, josef.p...@gmail.com wrote: Just using in might promise more than it does, eg. it works only for one dimensional arrays, maybe in1d. With in, Then 'in_1d' I found arraysetops because of unique1d, but I didn't figure out what the subpackage really

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2009-06-04 Thread Chris Colbert
Sebastian is right. Since Matlab r2007 (i think that's the version) it has included support for multi-core architecture. On my core2 Quad here at the office, r2008b has no problem utilizing 100% cpu for large matrix multiplications. If you download and build atlas and lapack from source and

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2009-06-04 Thread Chris Colbert
I should update after reading the thread Sebastian linked: The current 1.3 version of numpy (don't know about previous versions) uses the optimized Atlas BLAS routines for numpy.dot() if numpy was compiled with these libraries. I've verified this on linux only, thought it shouldnt be any

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2009-06-04 Thread Anne Archibald
2009/6/4 David Paul Reichert d.p.reich...@sms.ed.ac.uk: Hi all, I would be glad if someone could help me with the following issue:  From what I've read on the web it appears to me that numpy should be about as fast as matlab. However, when I do simple matrix multiplication, it consistently

Re: [Numpy-discussion] matrix default to column vector?

2009-06-04 Thread Christopher Barker
Keith Goodman wrote: Maybe announcing that numpy will drop support for matrices in a future version (3.0, ...) would save a lot of pain in the long run. Or make them better. There was a pretty good discussion of this a while back on this list. We all had a lot of opinions, and there were some

Re: [Numpy-discussion] matrix default to column vector?

2009-06-04 Thread Tommy Grav
On Jun 4, 2009, at 5:25 PM, Christopher Barker wrote: Keith Goodman wrote: Maybe announcing that numpy will drop support for matrices in a future version (3.0, ...) would save a lot of pain in the long run. Or make them better. There was a pretty good discussion of this a while back

Re: [Numpy-discussion] matrix default to column vector?

2009-06-04 Thread Alan G Isaac
On 6/4/2009 5:27 PM Tommy Grav apparently wrote: Or the core development team split the matrices out of numpy and make it as separate package that the people that use them could pick up and run with. This too would be a mistake, I believe. But it depends on whether a goal is to have more

Re: [Numpy-discussion] matrix default to column vector?

2009-06-04 Thread Tommy Grav
On Jun 4, 2009, at 5:41 PM, Alan G Isaac wrote: On 6/4/2009 5:27 PM Tommy Grav apparently wrote: Or the core development team split the matrices out of numpy and make it as separate package that the people that use them could pick up and run with. This too would be a mistake, I believe.

Re: [Numpy-discussion] [SciPy-user] Scipy 0.7.1rc1 released

2009-06-04 Thread David Cournapeau
Matthew Brett wrote: Hi, The RC1 for 0.7.1 scipy release has just been tagged. This is a bug-only release I feel (y)our pain, but don't you mean 'bug-fix only release'? ;-) Actually, there is one big bug on python 2.6 for mac os x, so maybe the bug-only is appropriate :)

Re: [Numpy-discussion] Speaking of fft code

2009-06-04 Thread David Cournapeau
Neal Becker wrote: Has this been considered as a candidate for our fft? http://sourceforge.net/projects/kissfft I looked at it when I was looking for a BSD-compatible FFT with support for prime factors (which fftpack does not handle). As Robert mentioned, I did not see any compelling

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2009-06-04 Thread David Warde-Farley
On 4-Jun-09, at 5:03 PM, Anne Archibald wrote: Apart from the implementation issues people have chimed in about already, it's worth noting that the speed of matrix multiplication depends on the memory layout of the matrices. So generating B instead directly as a 100 by 500 matrix might affect

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2009-06-04 Thread David Cournapeau
David Warde-Farley wrote: On 4-Jun-09, at 5:03 PM, Anne Archibald wrote: Apart from the implementation issues people have chimed in about already, it's worth noting that the speed of matrix multiplication depends on the memory layout of the matrices. So generating B instead directly as a

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread josef . pktd
On Thu, Jun 4, 2009 at 4:52 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Thu, Jun 04, 2009 at 04:43:39PM -0400, josef.p...@gmail.com wrote: Just using in might promise more than it does, eg. it works only for one dimensional arrays, maybe in1d. With in, Then 'in_1d' No, if the

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Robert Cimrman
josef.p...@gmail.com wrote: On Thu, Jun 4, 2009 at 2:58 PM, Alan G Isaac ais...@american.edu wrote: On 6/4/2009 1:27 PM josef.p...@gmail.com apparently wrote: Note: there are two versions of the docs for np.intersect1d, the currently published docs which describe the actual behavior (for the

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Robert Cimrman
Kim Hansen wrote: Concerning the name setmember1d_nu, I personally find it quite verbose and not the name I would expect as a non-insider coming to numpy and not knowing all the names of the more special hidden-away functions and not being a python-wiz either. To explain the naming: those

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Robert Cimrman
Anne Archibald wrote: 2009/6/4 josef.p...@gmail.com: intersect1d should throw a domain error if you give it arrays with non-unique elements, which is not done for speed reasons It seems to me that this is the basic source of the problem. Perhaps this can be addressed? I realize

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread Robert Cimrman
josef.p...@gmail.com wrote: On Thu, Jun 4, 2009 at 4:30 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Thu, Jun 04, 2009 at 10:27:11PM +0200, Kim Hansen wrote: in(b) or in_iterable(b) method, such that you could do a.in(b) which would return a boolean array of the same shape as a

Re: [Numpy-discussion] extract elements of an array that are contained in another array?

2009-06-04 Thread josef . pktd
On Fri, Jun 5, 2009 at 1:48 AM, Robert Cimrman cimrm...@ntc.zcu.cz wrote: josef.p...@gmail.com wrote: On Thu, Jun 4, 2009 at 4:30 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Thu, Jun 04, 2009 at 10:27:11PM +0200, Kim Hansen wrote: in(b) or in_iterable(b) method, such that you