def stde_median(data, axis=None):
def _stdemed_1D(data):<EOL><INDENT>data = np.sort(data.compressed())<EOL>n = len(data)<EOL>z = <NUM_LIT><EOL>k = int(np.round((n+<NUM_LIT:1>)/<NUM_LIT> - z * np.sqrt(n/<NUM_LIT>),<NUM_LIT:0>))<EOL>return ((data[n-k] - data[k-<NUM_LIT:1>])/(<NUM_LIT>*z))<EOL><DEDENT>data = ma.array(data, copy=False, subok=True)<EOL>if (axis is None):<EOL><INDENT>return _stdemed_1D(data)<EOL><DEDENT>else:<EOL><INDENT>if data.ndim > <NUM_LIT:2>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % data.ndim)<EOL><DEDENT>return ma.apply_along_axis(_stdemed_1D, axis, data)<EOL><DEDENT>
Returns the McKean-Schrader estimate of the standard error of the sample
    median along the given axis. masked values are discarded.

    Parameters
    ----------
    data : ndarray
        Data to trim.
    axis : {None,int}, optional
        Axis along which to perform the trimming.
        If None, the input array is first flattened.