def stde_median(data, axis=None):
 def _stdemed_1D(data):
  data = np.sort(data.compressed())
  n = len(data)
  z = 2.5758293035489004
  k = int(np.round((((n + 1) / 2.0) - (z * np.sqrt((n / 4.0)))), 0))
  return ((data[(n - k)] - data[(k - 1)]) / (2.0 * z))
 data = ma.array(data, copy=False, subok=True)
 if (axis is None):
  return _stdemed_1D(data)
 else:
  if (data.ndim > 2):
   raise ValueError(("Array 'data' must be at most two dimensional, but got data.ndim = %d" % data.ndim))
  return ma.apply_along_axis(_stdemed_1D, axis, data)

def stde_median ( data , axis = None ) : def _stdemed_1D ( data ) : data = np . sort ( data . compressed ( ) ) n = len ( data ) z = 2.5758293035489004 k = int ( np . round ( ( ( ( n + 1 ) / 2.0 ) - ( z * np . sqrt ( ( n / 4.0 ) ) ) ) , 0 ) ) return ( ( data [ ( n - k ) ] - data [ ( k - 1 ) ] ) / ( 2.0 * z ) ) data = ma . array ( data , copy = False , subok = True ) if ( axis is None ) : return _stdemed_1D ( data ) else : if ( data . ndim > 2 ) : raise ValueError ( ( "Array 'data' must be at most two dimensional, but got data.ndim = %d" % data . ndim ) ) return ma . apply_along_axis ( _stdemed_1D , axis , data )
returns the mckean-schrader estimate of the standard error of the sample median along the given axis .