code: def mad(a):
      '''Calculate the median absolute deviation of a sample
      
      a - a numpy array-like collection of values
      
      returns the median of the deviation of a from its median.
      '''
      a = np.asfarray(a).flatten()
      return np.median(np.abs(a - np.median(a))f mad(a):
      '''Calculate the median absolute deviation of a sample
      
      a - a numpy array-like collection of values
      
      returns the median of the deviation of a from its median.
      '''
      a = np.asfarray(a).flatten()
      return np.median(np.abs(a - np.median(a)))
docs: Calculate the median absolute deviation of a sample
      
      a - a numpy array-like collection of values
      
      returns the median of the deviation of a from its median.