gammaincinv(a, y) returns x such that gammainc(a, x) = y.
scipy.special.gammainc
scipy.special.gammaincc