def _ppf(self, q, n, p):
        vals = ceil(special.bdtrik(q, n, p))
        vals1 = np.maximum(vals - 1, 0)
        temp = special.bdtr(vals1, n, p)
        return np.where(temp >= q, vals1, vals)
dataset/ETHPy150Open scipy/scipy/scipy/stats/_discrete_distns.py/binom_gen._ppf/original