code: def fit_gaussian(samples, ddof=0):
      
      if len(samples.shape) == 1:
          return np.mean(samples), np.std(samples, ddof=ddof)
      return np.mean(samples, axis=1), np.std(samples, axis=1, ddof=ddof)
docs: Calculates the mean and the standard deviation of the given samples.
  
      Args:
          samples (ndarray): a one or two dimensional array. If one dimensional we calculate the fit using all
              values. If two dimensional, we fit the Gaussian for every set of samples over the first dimension.
          ddof (int): the difference degrees of freedom in the std calculation. See numpy.