I have computed a test statistic that is distributed as a chi square with 1 degree of freedom, and want to find out what P-value this corresponds to using python.
I
You meant to do:
>>> 1 - stats.chi2.cdf(3.84, 1) 0.050043521248705147