code: def mad(a, normalize=True, axis=0):
      
      from scipy.stats import norm
      a = np.asarray(a)
      c = norm.ppf(3 / 4.) if normalize else 1
      center = np.apply_over_axes(np.median, a, axis)
      return np.median((np.fabs(a - center)) / c, axis=axis)
docs: Median Absolute Deviation along given axis of an array.
  
      Parameters
      ----------
      a : array-like
          Input array.
      normalize : boolean.
          If True, scale by a normalization constant (~0.67)
      axis : int, optional
          The defaul is 0. Can also be None.
  
      Returns
      -------
      mad : float
          mad = median(abs(a - median(a))) / c
  
      References
      ----------
      .. [1] https://en.wikipedia.org/wiki/Median_absolute_deviation
  
      Examples
      --------
      >>> from pingouin import mad
      >>> a = [1.2, 5.4, 3.2, 7.8, 2.5]
      >>> mad(a)
      2.965204437011204
  
      >>> mad(a, normalize=False)
      2.0