code: def gbayes(x0, g_est, sigma):
      
  
      Kx = norm().pdf((g_est[0] - x0) / sigma)
      post = Kx * g_est[1]
      post /= sum(post)
      return sum(post * g_est[0])
docs: Estimate Bayes posterior with Gaussian noise [Efron2014]_.
  
      Parameters
      ----------
      x0: ndarray
          an observation
      g_est: float
          a prior density, as returned by gfit
      sigma: int
          noise estimate
  
      Returns
      -------
      An array of the posterior estimate E[mu | x0]