code: def within_n_std(df, n=3):
      
      means = df.mean()
      stds = df.std()
      inliers = (np.abs(df[means.index] - means) < n * stds)
      if not np.all(inliers):
          msg = generic.bad_locations(~inliers)
          raise AssertionError(msg)
      return df
docs: Assert that every value is within ``n`` standard
      deviations of its column's mean.
  
      Parameters
      ==========
      df : DataFame
      n : int
        number of standard deviations from the mean
  
      Returns
      =======
      df : DataFrame