def _stats(self, b, moments='mv'):
        mu, mu2, g1, g2 = None, None, None, None
        if 'm' in moments:
            mask = b > 1
            bt = extract(mask, b)
            mu = valarray(shape(b), value=inf)
            place(mu, mask, bt / (bt-1.0))
        if 'v' in moments:
            mask = b > 2
            bt = extract(mask, b)
            mu2 = valarray(shape(b), value=inf)
            place(mu2, mask, bt / (bt-2.0) / (bt-1.0)**2)
        if 's' in moments:
            mask = b > 3
            bt = extract(mask, b)
            g1 = valarray(shape(b), value=nan)
            vals = 2 * (bt + 1.0) * sqrt(bt - 2.0) / ((bt - 3.0) * sqrt(bt))
            place(g1, mask, vals)
        if 'k' in moments:
            mask = b > 4
            bt = extract(mask, b)
            g2 = valarray(shape(b), value=nan)
            vals = (6.0*polyval([1.0, 1.0, -6, -2], bt) /
                    polyval([1.0, -7.0, 12.0, 0.0], bt))
            place(g2, mask, vals)
        return mu, mu2, g1, g2
dataset/ETHPy150Open scipy/scipy/scipy/stats/_continuous_distns.py/pareto_gen._stats/original