t - table and degrees of freedom
See this post on machinelearningmastery to use scipy to find critical t value. This code below seemed to work.

from scipy.stats import t

#savings calc
diff = actualKwh - total

#compute precision of results, starting with standard error
stdErr = totalStd / math.sqrt(len(total.index))


# define probability &amp; degrees of freedom
p = 0.95
degf = len(data.index) - 1

#print("dfLen=", len(data.index))

#print("degf=", degf)


# retrieve t value
t = t.ppf(p, degf)
#print("t =", t)


absPrec = t * stdErr 
#print("absPrec =", int(absPrec))


relPrec = (100 * (absPrec / diff)).round(decimals=1)
#print("relPrec =", relPrec)