[Numpy-discussion] subclassing recarray

2007-01-01 Thread Matthew Koichi Grimes
Is it hard to subclass recarrays? I'm currently working on a subclass that doesn't add much; just some methods that sets all the values to zero and other similarly trivial things. It'd be nice to make it work, but if I have to use external functions on a plain recarray instead of this subclass

Re: [Numpy-discussion] Scalar values with a matrix

2007-01-01 Thread Charles R Harris
On 1/1/07, Colin J. Williams <[EMAIL PROTECTED]> wrote: What is the best way to treat scalar values from a matrix? It seems that it's best to treat them as a simple Python values and not to leave them wrapped up in the ndarray structure. I would welcome advice. The problem is illustrated belo

[Numpy-discussion] Scalar values with a matrix

2007-01-01 Thread Colin J. Williams
What is the best way to treat scalar values from a matrix? It seems that it's best to treat them as a simple Python values and not to leave them wrapped up in the ndarray structure. I would welcome advice. The problem is illustrated below. Colin W. # tMul.py import numpy.core as _n a= _n.arang

Re: [Numpy-discussion] argmax()

2007-01-01 Thread Niklas Saers
Hi, while answering your email (making a smaller version with data via pickle) I noticed that the variable "set" contained a very large matrix (I'm not quite sure but I believe I may have thrown 2048 dimensions at it with a multiplication that went wrong, giving a "set" object that pickled

Re: [Numpy-discussion] argmax()

2007-01-01 Thread Alan G Isaac
On Mon, 1 Jan 2007, Niklas Saers apparently wrote: > The problem is that set is an array of 2048 numbers. However, when I > run this function I get: > "maxPos = 7925760, while len(set) is 2048" > I do not understand why I get such a high index. Do you have any > suggestions? Can you post cod

[Numpy-discussion] argmax()

2007-01-01 Thread Niklas Saers
Hi, I'm quite new to numpy. My understanding of argmax() is that it gives the index of the highest number in the array, just like: from numpy import * a=array(range(4096)) a=a*15 argmax(a) gives 4095. But, when I use this within my program I have a little function: def localMaxima(set):