median(array, width=None, axis=None, even=False)¶
Replicate the IDL
Compute the median of this array.
Size of the neighborhood in which to compute the median (i.e., perform median filtering). If omitted, the median of the whole array is returned.
Compute the median over this axis for a multi-dimensional array. If ommitted, the median over the entire array will be returned. If set, this function will behave as though
If set to
True, the median of arrays with an even number of elements will be the average of the middle two values.
The median of the array.
For arrays with an even number of elements, the
numpy.median()function behaves like
MEDIAN(array, /EVEN), so the absence of the
evenkeyword has to turn off that behavior.
For median filtering, this uses
scipy.signal.medfilt2d()under the hood, but patches up the values on the array boundaries to match the return values of the IDL