def _munp(self, n, b):
        # wrong answer with formula, same as in continuous.pdf
        # return gam(n+1)-special.gammainc(1+n, b)
        if n == 1:
            return (1-(b+1)*exp(-b))/(-special.expm1(-b))
        elif n == 2:
            return 2*(1-0.5*(b*b+2*b+2)*exp(-b))/(-special.expm1(-b))
        else:
            # return generic for higher moments
            # return rv_continuous._mom1_sc(self, n, b)
            return self._mom1_sc(n, b)
dataset/ETHPy150Open scipy/scipy/scipy/stats/_continuous_distns.py/truncexpon_gen._munp/original