Re: [Numpy-discussion] Slicing slower than matrix multiplication?

2009-12-12 Thread Jasper van de Gronde
Francesc Alted wrote: ... Yeah, I think taking slices here is taking quite a lot of time: In [58]: timeit E + Xi2[P/2,:] 10 loops, best of 3: 3.95 µs per loop In [59]: timeit E + Xi2[P/2] 10 loops, best of 3: 2.17 µs per loop don't know why the additional ',:' in the slice is

[Numpy-discussion] indices of values contained in a list

2009-12-12 Thread Ernest Adrogué
Hi, Suppose I have a flat array, and I want to know the indices corresponding to values contained in a list of arbitrary lenght. Intuitively I would have done: a = np.array([1,2,3,4]) np.nonzero(a in (0,2,4)) However the in operator doesn't work element-wise, instead it compares the whole

Re: [Numpy-discussion] indices of values contained in a list

2009-12-12 Thread Gary Ruben
np.setmember1d(a,b) does the same as your reduce(np.logical_or, [a == i for i in b]) but it's actually slower on my machine! Gary R. Ernest Adrogué wrote: Hi, Suppose I have a flat array, and I want to know the indices corresponding to values contained in a list of arbitrary lenght.

Re: [Numpy-discussion] Slicing slower than matrix multiplication?

2009-12-12 Thread Bruce Southey
On Sat, Dec 12, 2009 at 5:59 AM, Jasper van de Gronde th.v.d.gro...@hccnet.nl wrote: Francesc Alted wrote: ... Yeah, I think taking slices here is taking quite a lot of time: In [58]: timeit E + Xi2[P/2,:] 10 loops, best of 3: 3.95 µs per loop In [59]: timeit E + Xi2[P/2] 10

Re: [Numpy-discussion] indices of values contained in a list

2009-12-12 Thread Keith Goodman
2009/12/12 Ernest Adrogué eadro...@gmx.net: Hi, Suppose I have a flat array, and I want to know the indices corresponding to values contained in a list of arbitrary lenght. Intuitively I would have done: a = np.array([1,2,3,4]) np.nonzero(a in (0,2,4)) However the in operator doesn't

[Numpy-discussion] Repeated dot products

2009-12-12 Thread T J
Hi, Suppose I have an array of shape: (n, k, k). In this case, I have n k-by-k matrices. My goal is to compute the product of a (potentially large) user-specified selection (with replacement) of these matrices. For example, x = [0,1,2,1,3,3,2,1,3,2,1,5,3,2,3,5,2,5,3,2,1,3,5,6] says that I

Re: [Numpy-discussion] Repeated dot products

2009-12-12 Thread josef . pktd
On Sat, Dec 12, 2009 at 4:55 PM, T J tjhn...@gmail.com wrote: Hi, Suppose I have an array of shape:  (n, k, k).  In this case, I have n k-by-k matrices.  My goal is to compute the product of a (potentially large) user-specified selection (with replacement) of these matrices. For example,  

Re: [Numpy-discussion] Repeated dot products

2009-12-12 Thread Denis Laxalde
Le samedi 12 décembre 2009 à 01:55 -0800, T J a écrit : Is there a better way? You may have a look at http://scipy.org/Cookbook/MultiDot Several alternatives are proposed. Cheers, -- Denis ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Repeated dot products

2009-12-12 Thread Anne Archibald
2009/12/12 T J tjhn...@gmail.com: Hi, Suppose I have an array of shape:  (n, k, k).  In this case, I have n k-by-k matrices.  My goal is to compute the product of a (potentially large) user-specified selection (with replacement) of these matrices. For example,   x =

Re: [Numpy-discussion] Import error in builds of 7726

2009-12-12 Thread Chris
Here is a log form a build of svn rev 7996 with no LDFLAGS specified, as recommended by Robert. The result is the same, however. http://files.me.com/fonnesbeck/y7e9v2 cf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Question on timeseries, for financial application

2009-12-12 Thread josef . pktd
On Sat, Dec 12, 2009 at 8:08 PM, THOMAS BROWNE totalb...@mac.com wrote: Hello all, Quite new to numpy / timeseries module, please forgive the elementary question. I wish to do quite to do a bunch of multivariate analysis on 1000 different financial markets series, each holding about 1800

Re: [Numpy-discussion] Question on timeseries, for financial application

2009-12-12 Thread Robert Ferrell
Have you considered creating a TimeSeries for each data series, and then putting them all together in a dict, keyed by symbol? One disadvantage of one big monster numpy array for all the series is that not all series may have a full set of 1800 data points. So the array isn't really nicely

Re: [Numpy-discussion] Import error in builds of 7726

2009-12-12 Thread David Cournapeau
On Sun, Dec 13, 2009 at 4:27 AM, Chris fonnesb...@gmail.com wrote: Here is a log form a build of svn rev 7996 with no LDFLAGS specified, as recommended by Robert. The result is the same, however. http://files.me.com/fonnesbeck/y7e9v2 I don't see any build error on this log ? David

Re: [Numpy-discussion] Import error in builds of 7726

2009-12-12 Thread Robert Kern
On Sun, Dec 13, 2009 at 00:37, David Cournapeau courn...@gmail.com wrote: On Sun, Dec 13, 2009 at 4:27 AM, Chris fonnesb...@gmail.com wrote: Here is a log form a build of svn rev 7996 with no LDFLAGS specified, as recommended by Robert. The result is the same, however.

Re: [Numpy-discussion] doctest improvements patch (and possible regressions)

2009-12-12 Thread Paul Ivanov
So far, no one has voiced objections, so should I go ahead and check this in? btw, thanks Mike, what about this one: (np.char.lstrip(c, ' ') == np.char.lstrip(c, '')).all() ... # XXX: is this a regression? this line now returns False -pi ... # np.char.lstrip(c,'') does not modify c