Re: [Numpy-discussion] concatenate a tuple of lists 10x slower in numpy 1.0.1

2007-01-19 Thread Travis Oliphant
Martin Spacek wrote: > Hello, > > I just upgraded from numpy 1.0b5 to 1.0.1, and I noticed that a part of > my code that was using concatenate() was suddenly far slower. I > downgraded to 1.0, and the slowdown disappeared. Here's the code > and the profiler results for 1.0 and 1.0.1: > I have n

[Numpy-discussion] concatenate a tuple of lists 10x slower in numpy 1.0.1

2007-01-19 Thread Martin Spacek
Hello, I just upgraded from numpy 1.0b5 to 1.0.1, and I noticed that a part of my code that was using concatenate() was suddenly far slower. I downgraded to 1.0, and the slowdown disappeared. Here's the code and the profiler results for 1.0 and 1.0.1: >>> import numpy as np >>> np.version.version

Re: [Numpy-discussion] svn numpy did not build on os x

2007-01-19 Thread Robert Kern
Srinath Vadlamani wrote: > This is what I'm using: > Python 2.4.4 (#1, Oct 18 2006, 10:34:39) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > > I'll try a new check out and try it again. I don't know where I got > python...where should I get it from? www.python.org Now, what gcc a

Re: [Numpy-discussion] svn numpy did not build on os x

2007-01-19 Thread Srinath Vadlamani
-- Message: 5 Date: Fri, 19 Jan 2007 17:29:53 -0700 From: "Brian Granger" <[EMAIL PROTECTED]> Subject: Re: [Numpy-discussion] svn numpy did not build on os x To: "Discussion of Numerical Python" Message-ID: <[EMAIL PROTECTED]>

Re: [Numpy-discussion] how to recognize a numpy-scalar type at the C level and how to convert

2007-01-19 Thread Travis Oliphant
Sebastian Haase wrote: >Hi again, >I finally bought the numpy-book. >Browsing through the 370 pages I found this: >PyArray IsScalar (op, cls) >Evaluates true if op is an instance of PyArrType Type. > >Is this what I need to check for a given scalar type. > > Yes. Remember that cls can be a "Ge

Re: [Numpy-discussion] how to recognize a numpy-scalar type at the C level and how to convert

2007-01-19 Thread Sebastian Haase
Hi again, I finally bought the numpy-book. Browsing through the 370 pages I found this: PyArray IsScalar (op, cls) Evaluates true if op is an instance of PyArrType Type. Is this what I need to check for a given scalar type. Numpy is really much more extensive (comprehensive) than I thought. Tha

Re: [Numpy-discussion] svn numpy did not build on os x

2007-01-19 Thread Brian Granger
I just did a clean checkout of numpy a few minutes ago (Intel mac book, Python 2.4.3 universal) and a simple python setup.py build worked fine. What Python are you using (where did you get it)? Is there something wierd going on with your gcc? Brian On 1/19/07, Srinath Vadlamani <[EMAIL PROTECTED

Re: [Numpy-discussion] svn numpy did not build on os x

2007-01-19 Thread Robert Kern
Srinath Vadlamani wrote: > I just did an svn up (1/19/07) and tried building numpy with no > success. It built fine yesterday (1/18/07). This is on OS X tiger. > Attached is the error output. I hope that attachments work with the > mailing list. Oh, and which version of gcc are you using? With

Re: [Numpy-discussion] svn numpy did not build on os x

2007-01-19 Thread Robert Kern
Srinath Vadlamani wrote: > I just did an svn up (1/19/07) and tried building numpy with no > success. It built fine yesterday (1/18/07). This is on OS X tiger. > Attached is the error output. I hope that attachments work with the > mailing list. Well, it's working for me on Intel and OS X 10.4

Re: [Numpy-discussion] Fast vector multiplication

2007-01-19 Thread Mark Janikas
Doh!!! Nice call. Thanks for the input. MJ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Timothy Hochberg Sent: Friday, January 19, 2007 2:52 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] Fast vector multiplication

Re: [Numpy-discussion] Fast vector multiplication

2007-01-19 Thread Timothy Hochberg
On 1/19/07, Mark Janikas <[EMAIL PROTECTED]> wrote: Hello all, I am trying to figure out the most efficient way to get the sum of the product of two vectors where id != id. E.g.: X = array([1,2,3]) Y = array([1,2,3]) Z = (1*2) + (1*3) + (2*1) + (2*3) + (3*1) + (3*2) = 22 I could

[Numpy-discussion] Fast vector multiplication

2007-01-19 Thread Mark Janikas
Hello all, I am trying to figure out the most efficient way to get the sum of the product of two vectors where id != id. E.g.: X = array([1,2,3]) Y = array([1,2,3]) Z = (1*2) + (1*3) + (2*1) + (2*3) + (3*1) + (3*2) = 22 I could obviously do this with loops, but I was wondering

Re: [Numpy-discussion] ANN: MaskedArray as a subclas s of ndarray - followup

2007-01-19 Thread Pierre GM
Eric, Travis, Thanks for the words of encouragements :) I'm all in favor of having maskedarray ported to C, but I won't be able to do it myself anytime soon. And I would have to learn C beforehands. Francesc's suggestion of using Pyrex sounds nice, I'll try and see what I can do with that > M

Re: [Numpy-discussion] rewriting in C (was ANN: Masked Array...)

2007-01-19 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Matt Knox wrote: > > >>Moving the implementation to the C-level also has its downside. To > >>me, at least, Python code is much more readable and hence easier to > >>maintain. > >> > >>Is there a way that we can implem

[Numpy-discussion] svn numpy did not build on os x

2007-01-19 Thread Srinath Vadlamani
I just did an svn up (1/19/07) and tried building numpy with no success. It built fine yesterday (1/18/07). This is on OS X tiger. Attached is the error output. I hope that attachments work with the mailing list. -- == Srinath Vadlaman

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray -?followup

2007-01-19 Thread Travis Oliphant
Matt Knox wrote: >>Moving the implementation to the C-level also has its downside. To >>me, at least, Python code is much more readable and hence easier to >>maintain. >> >>Is there a way that we can implement only the speed-critical methods >>in C? >> >>Cheers >>Stéfan >> >> >> > >Implementi

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray?-?followup

2007-01-19 Thread Robert Kern
Stefan van der Walt wrote: > A "nice C level api" sounds like the definition of oxymoron :) Why > would we argue for more C than absolutely necessary in a Python-based > library? Well, it's more often absolutely necessary than you might think. Any common operation on the array should be written i

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray?-?followup

2007-01-19 Thread Francesc Altet
El dv 19 de 01 del 2007 a les 18:08 +0200, en/na Stefan van der Walt va escriure: > On Fri, Jan 19, 2007 at 02:13:52PM +, Matt Knox wrote: > > > Moving the implementation to the C-level also has its downside. To > > > me, at least, Python code is much more readable and hence easier to > > > ma

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray?-?followup

2007-01-19 Thread Stefan van der Walt
On Fri, Jan 19, 2007 at 02:13:52PM +, Matt Knox wrote: > > Moving the implementation to the C-level also has its downside. To > > me, at least, Python code is much more readable and hence easier to > > maintain. > > > > Is there a way that we can implement only the speed-critical methods > >

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray -?followup

2007-01-19 Thread Matt Knox
> Moving the implementation to the C-level also has its downside. To > me, at least, Python code is much more readable and hence easier to > maintain. > > Is there a way that we can implement only the speed-critical methods > in C? > > Cheers > Stéfan > Implementing the whole thing in C also h

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray - followup

2007-01-19 Thread Matt Knox
> That time series module sounds very interesting! Is it available > somewhere, or some documentation? > > Thank you, > Sven > Not really any documentation yet, and the code is still in a state of flux, so expect frequent changes/additions at this point still. No concern is being given to "bac

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray - followup

2007-01-19 Thread Stefan van der Walt
On Fri, Jan 19, 2007 at 10:56:16AM +0100, Sven Schreiber wrote: > Matt Knox schrieb: > > > > > I am definitely in favor of the new maskedarray implementation. I've been > > working with Pierre on a time series module which is a subclass of the new > > masked array implementation, and having it as

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray -?followup

2007-01-19 Thread Stefan van der Walt
On Thu, Jan 18, 2007 at 06:18:22PM +, Matt Knox wrote: > > For 1.1 I would really like to move most of the often-used sub-classes > > of the ndarray to the C-level and merge in functionality from CVXOPT. > > Moving the implementation to the C-level would be awesome. In particular, > __getitem

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray - followup

2007-01-19 Thread Sven Schreiber
Matt Knox schrieb: > > I am definitely in favor of the new maskedarray implementation. I've been > working with Pierre on a time series module which is a subclass of the new > masked array implementation, and having it as a subclass of ndarray definitely > has advantages (and no real disadvantage