Reputation: 35
Is there a equivalent of pchisq R command in Python. As was said in this question, I were using chi2.ppf from scipy but I am not getting the same results as in R. For example, the following code:
R:
pchisq(38972.27814544528, df = 1)
Out: 1
pchisq(40569.99000034796, df = 1)
Out: 1
Python:
chi2.ppf(38972.27814544528, df = 1)
Out: NaN
chi2.ppf(40569.99000034796, df = 1)
Out: NaN
Thaks in advance for the help.
Upvotes: 1
Views: 600
Reputation: 2419
You can use stats.chi2.cdf
in Python:
stats.chi2.cdf(38972.27814544528,df=1)
# 1.0
Upvotes: 3