'Percent point function (inverse of `cdf`) at q of the given RV.
Parameters
q : array_like
lower tail probability
arg1, arg2, arg3,... : array_like
The shape parameter(s) for the distribution (see docstring of the
instance object for more information)
loc : array_like, optional
location parameter (default=0)
scale : array_like, optional
scale parameter (default=1)
Returns
x : array_like
quantile corresponding to the lower tail probability q.'

def ppf(self, q, *args, **kwds):

    (args, loc, scale) = self._parse_args(*args, **kwds)
    (q, loc, scale) = map(asarray, (q, loc, scale))
    args = tuple(map(asarray, args))
    cond0 = ((self._argcheck(*args) & (scale > 0)) & (loc == loc))
    cond1 = ((0 < q) & (q < 1))
    cond2 = (cond0 & (q == 0))
    cond3 = (cond0 & (q == 1))
    cond = (cond0 & cond1)
    output = valarray(shape(cond), value=self.badvalue)
    lower_bound = ((self.a * scale) + loc)
    upper_bound = ((self.b * scale) + loc)
    place(output, cond2, argsreduce(cond2, lower_bound)[0])
    place(output, cond3, argsreduce(cond3, upper_bound)[0])
    if np.any(cond):
        goodargs = argsreduce(cond, *(((q,) + args) + (scale, loc)))
        (scale, loc, goodargs) = (goodargs[(-2)], goodargs[(-1)], goodargs[:(-2)])
        place(output, cond, ((self._ppf(*goodargs) * scale) + loc))
    if (output.ndim == 0):
        return output[()]
    return output
