[Numpy-discussion] Medians that ignore values
Thu Sep 18 21:54:49 CDT 2008
2008/9/18 David Cournapeau <email@example.com>:
> Peter Saffrey wrote:
>> Is this the correct behavior for median with nan?
> That's the expected behavior, at least :) (this is also the expected
> behavior of most math packages I know, including matlab and R, so this
> should not be too surprising if you have used those).
I don't think I agree:
In : np.median([1,3,nan])
In : np.median([1,nan,3])
In : np.median([nan,1,3])
I think the expected behaviour would be for all of these to return nan.
More information about the Numpy-discussion