code: def outliers_grubbs(x, hypo = False, alpha = 0.05):
  
      
  
      val = np.max(np.abs(x - np.mean(x)))
      ind = np.argmax(np.abs(x - np.mean(x)))
      G = val / np.std(x, ddof=1)
      N = len(x)
      result = G > (N - 1)/np.sqrt(N) * np.sqrt((t.ppf(1-alpha/(2*N), N-2) ** 2) / (N - 2 + t.ppf(1-alpha/(2*N), N-2) ** 2 ))
  
      if hypo:
          return result
      else:
          if result:
              return np.delete(x, ind)
          else:
              return x
docs: Grubbs' Test for Outliers [1]_. This is the two-sided version of the test.
  
      The null hypothesis implies that there are no outliers in the data set.
  
      Parameters
      ----------
      x : array_like or ndarray, 1d
          An array, any object exposing the array interface, containing
          data to test for an outlier in.
  
      hypo : bool, optional
          Specifies whether to return a bool value of a hypothesis test result.
          Returns True when we can reject the null hypothesis. Otherwise, False.
          Available options are:
          1) True - return a hypothesis test result
          2) False - return a filtered array without an outlier (default)
  
      alpha : float, optional
          Significance level for a hypothesis test. Default is 0.05.
  
      Returns
      -------
      Numpy array if hypo is False or a bool value of a hypothesis test result.
  
      Notes
      -----
      .. [1] http://www.itl.nist.gov/div898/handbook/eda/section3/eda35h1.htm
  
      Examples
      --------
  
      >>> x = np.array([199.31,199.53,200.19,200.82,201.92,201.95,202.18,245.57])
      >>> ph.outliers_grubbs(x)
      array([ 199.31,  199.53,  200.19,  200.82,  201.92,  201.95,  202.18])