[Numpy-discussion] average of array containing NaN
Mon Jun 25 12:38:13 CDT 2007
On 6/25/07, Giorgio F. Gilestro <email@example.com> wrote:
> I find myself in a situation where an array may contain not-Numbers
> that I set as NaN.
> Yet, whatever operation I do on that array( average, sum...) will
> threat the NaN as infinite values rather then ignoring them as I'd
> like it'd do.
Am I missing something? Is this a bug or a feature? :-)
Neither. The best behaviour would probably be to throw an exception, but the
extra checking that would require might well slow down other stuff.
Try looking at the following functions, they should let you do what you
'nanargmax', 'nanargmin', 'nanmax', 'nanmin', 'nansum'
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion