code: def fit_arrhenius(temps, diffusivities):
      
      t_1 = 1 / np.array(temps)
      logd = np.log(diffusivities)
      # Do a least squares regression of log(D) vs 1/T
      a = np.array([t_1, np.ones(len(temps))]).T
      w, res, _, _ = np.linalg.lstsq(a, logd, rcond=None)
      w = np.array(w)
      n = len(temps)
      if n > 2:
          std_Ea = (res[0] / (n - 2) / (
          n * np.var(t_1))) ** 0.5 * const.k / const.e
      else:
          std_Ea = None
      return -w[0] * const.k / const.e, np.exp(w[1]), std_Ea
docs: Returns Ea, c, standard error of Ea from the Arrhenius fit:
          D = c * exp(-Ea/kT)
  
      Args:
          temps ([float]): A sequence of temperatures. units: K
          diffusivities ([float]): A sequence of diffusivities (e.g.,
              from DiffusionAnalyzer.diffusivity). units: cm^2/s