code: def _masked_median(data, axis=None):
      
  
      _median = np.ma.median(data, axis=axis)
      if axis is None and np.ma.isMaskedArray(_median):
          _median = _median.item()
  
      return _median
docs: Calculate the median of a (masked) array.
  
      This function is necessary for a consistent interface across all
      numpy versions.  A bug was introduced in numpy v1.10 where
      `numpy.ma.median` (with ``axis=None``) returns a single-valued
      `~numpy.ma.MaskedArray` if the input data is a `~numpy.ndarray` or
      if the data is a `~numpy.ma.MaskedArray`, but the mask is `False`
      everywhere.
  
      Parameters
      ----------
      data : array-like
          The input data.
      axis : int or `None`, optional
          The array axis along which the median is calculated.  If
          `None`, then the entire array is used.
  
      Returns
      -------
      result : float or `~numpy.ma.MaskedArray`
          The resulting median.  If ``axis`` is `None`, then a float is
          returned, otherwise a `~numpy.ma.MaskedArray` is returned.