What is the pandas equivalent of R's qnorm()

Viewed 3393

I am moving some code from R to Anaconda Python. The R code uses qnorm, documented as "quantile function for the normal distribution with mean equal to mean and standard deviation equal to sd."

The call and parameters are:

   qnorm(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)
   p           vector of probabilities.
   mean        vector of means.
   sd          vector of standard deviations.
   log.p       logical; if TRUE, probabilities p are given as log(p).
   lower.tail  logical; if TRUE (default), probabilities are
                            P[X≤x] otherwise, P[X].

I don't see any equivalent in pandas.Series. Have I missed it, is it on another object, or is there some equivalent in another library?

2 Answers

Just to expand @miradulo answer. If you want to get also qnorm(lower.tail=FALSE) you can just multiply by -1:

In R:

qnorm(0.8, lower.tail = F)
-0.8416212

In python

from scipy.stats import norm

norm.ppf(0.8) * -1
-0.8416212
Related