Re: [Numpy-discussion] nan functions convert matrix to array

2006-12-03 Thread Pierre GM
On Friday 01 December 2006 17:56, Keith Goodman wrote: ... > Would it break anything to change the first line of the nan functions from > a = array(a) > to > a = asanyarray(a) > ? Seeing what the nan functions do, I don't think that would be a problem. An expception would be raised if the operat

Re: [Numpy-discussion] nan functions convert matrix to array

2006-12-01 Thread Pierre GM
On Friday 01 December 2006 16:46, Keith Goodman wrote: > The first line of the nan functions (such as nansum, nanmin, nanmax) is > Is there some way to make it matrix in, matrix out? Quick workaround: Overwrite these functions with your own, where 'array' or 'asarray' in the first line is replac

[Numpy-discussion] nan functions convert matrix to array

2006-12-01 Thread Keith Goodman
The first line of the nan functions (such as nansum, nanmin, nanmax) is y = array(a) That leads to matrix in, array out. Is there some way to make it matrix in, matrix out? Here, for example, is nansum: def nansum(a, axis=None): """Sum the array over the given axis, treating NaNs as 0.