Re: [Numpy-discussion] matrix problem: float to matrix power

2007-10-30 Thread Charles R Harris
On 10/31/07, Alan G Isaac <[EMAIL PROTECTED]> wrote: > >>> 1.0**numpy.array([1,2,3]) > array([ 1., 1., 1.]) > >>> 1.0**numpy.mat([1,2,3]) > Traceback (most recent call last): > File "", line 1, in > TypeError: unsupported operand type(s) for ** or pow(): 'float' and 'matrix' > > Why the restri

[Numpy-discussion] matrix problem: float to matrix power

2007-10-30 Thread Alan G Isaac
>>> 1.0**numpy.array([1,2,3]) array([ 1., 1., 1.]) >>> 1.0**numpy.mat([1,2,3]) Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for ** or pow(): 'float' and 'matrix' Why the restriction for matrices? Same question for matrices conformable for broa

Re: [Numpy-discussion] MTL 4

2007-10-30 Thread Stefan van der Walt
On Tue, Oct 30, 2007 at 10:48:25AM -0600, Charles R Harris wrote: > Just a note that an alpha version of the hitherto mostly invisible > MTL4 library has been released. It is template based and has automatic > bindings to blas. You can download it from > http://www.osl.iu.edu/research/mtl/mtl4/. I

Re: [Numpy-discussion] vectorizing loops

2007-10-30 Thread Mathew Yeates
Thanks all for your suggestions. I see it brought up a lot of interesting asides. But my loop was simple enough that I was able to figure it out. I also took a look at NumExpr. While it wasn't something I needed for vectorizing, it still looks very interesting. What kinds of performance improv

Re: [Numpy-discussion] trailing max

2007-10-30 Thread Matt Knox
Pierre GM gmail.com> writes: > > On Tuesday 30 October 2007 13:31:41 John Hunter wrote: > > In financial time series, it is very common to keep track of things > > like a trailing N day max, trailing N day average, etc. > > John, > Have you ever tried the timeseries package in the scipy SVN ?

Re: [Numpy-discussion] trailing max

2007-10-30 Thread Stefan van der Walt
On Tue, Oct 30, 2007 at 12:31:41PM -0500, John Hunter wrote: > In financial time series, it is very common to keep track of things > like a trailing N day max, trailing N day average, etc. Generally, > for a 1D array x, I'd like to be able to efficiently compute a new > len(x) vector where y[i] =

Re: [Numpy-discussion] trailing max

2007-10-30 Thread Karol Langner
On Tuesday 30 October 2007 13:55, Pierre GM wrote: > On Tuesday 30 October 2007 13:31:41 John Hunter wrote: > > In financial time series, it is very common to keep track of things > > like a trailing N day max, trailing N day average, etc. > > John, > Have you ever tried the timeseries package in t

Re: [Numpy-discussion] trailing max

2007-10-30 Thread Pierre GM
On Tuesday 30 October 2007 13:31:41 John Hunter wrote: > In financial time series, it is very common to keep track of things > like a trailing N day max, trailing N day average, etc. John, Have you ever tried the timeseries package in the scipy SVN ? We (Matt Knox and I) tried to address some of

[Numpy-discussion] trailing max

2007-10-30 Thread John Hunter
In financial time series, it is very common to keep track of things like a trailing N day max, trailing N day average, etc. Generally, for a 1D array x, I'd like to be able to efficiently compute a new len(x) vector where y[i] = func(x[i-N:]) and I need to be able to handle edge effects (eg where

[Numpy-discussion] MTL 4

2007-10-30 Thread Charles R Harris
Just a note that an alpha version of the hitherto mostly invisible MTL4 library has been released. It is template based and has automatic bindings to blas. You can download it from http://www.osl.iu.edu/research/mtl/mtl4/. Chuck ___ Numpy-discussion mail

Re: [Numpy-discussion] More intel about the bug "Reference count error detected"

2007-10-30 Thread Matthieu Brucher
Hi again, I'm trying to debug what is going on, but I do not know much about the universal functions. I'm trying to understand what PyUFunc_GenericFunction() does and what the parameters should be. Perhaps I should move to the numpy development list ? Matthieu 2007/10/29, Matthieu Brucher <[EMAI