def _ppf(self, q, n, p):
        vals = ceil(special.nbdtrik(q, n, p))
        vals1 = (vals-1).clip(0.0, np.inf)
        temp = self._cdf(vals1, n, p)
        return np.where(temp >= q, vals1, vals)
dataset/ETHPy150Open scipy/scipy/scipy/stats/_discrete_distns.py/nbinom_gen._ppf/original