[Numpy-discussion] nansum, nanmean, nanvar, nanstd
Charles R Harris
charlesr.harris at gmail.com
Fri Jul 12 21:46:54 EDT 2013
I've been working on Benjamin's PR, which I took down as he didn't have
time to finish it. I've made the following changes and thought I'd run them
past others before putting up a new pull request.
1. The new functions are consolidated with the old ones inn (new)
2. There is a new test module numpy/lib/tests/test_nanfunctions.py
3. The functions punt to standard routines if the array is not inexact.
4. If the array is inexact, then so must be the optional out and dtype
5. Nans are returned for all nan axis, no warnings are raised.
6. If cnt - ddof <= 0 the result is Nan for that axis, no warnings are
7. For scalar returns the type of the array, or the type given by the
dtype option, is preserved.
Number 7 does not hold for current mean, var, and std. I propose that those
functions be fixed.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion