Is there a python equivalent of R's qchisq function?

chi-squared, python, r, scipy, statistics

Solution

It's `scipy.stats.chi2.ppf` - Percent point function (inverse of cdf). E.g., in R:

> qchisq(0.05,5)
[1] 1.145476

in Python:

In [8]: scipy.stats.chi2.ppf(0.05, 5)
Out[8]: 1.1454762260617695

Problem

The R `qchisq` function converts a p-value and number of degrees of freedom to the corresponding chi-squared value. Is there a Python library that has an equivalent? I've looked around in SciPy without finding anything.

Original source

Related problems