[Numpy-discussion] Medians that ignore values

Stéfan van der Walt stefan at sun.ac.za
Fri Sep 19 04:36:43 EDT 2008


2008/9/19 Anne Archibald <peridot.faceted at gmail.com>:
> I think the numpy attitude to nans should be that they are unexpected
> bogus values that signify that something went wrong with the
> calculation somewhere. They can be left in place for most operations,
> but any operation that depends on the value should (ideally) return
> nan, or failing that, raise an exception.

I agree completely.

> I am assuming that appropriate masked sort/amax/maximum/mean/median
> exist already. They're definitely needed, so how much effort is it
> worth putting in to duplicate that functionality with nans instead of
> masked elements?

Unfortunately, this needs to happen at the C level.  Is anyone reading
this willing to spend some time taking care of the issue?  It's an
important one.

Stéfan



More information about the NumPy-Discussion mailing list