def Marginal(self, i, name=''):
        """Gets the marginal distribution of the indicated variable.

        i: index of the variable we want

        Returns: Pmf
        """
        pmf = Pmf(name=name)
        for vs, prob in self.Items():
            pmf.Incr(vs[i], prob)
        return pmf
def Marginal ( self , i , name = '' ) : pmf = Pmf ( name = name ) for vs , prob in self . Items ( ) : pmf . Incr ( vs [ i ] , prob ) return pmf
Gets the marginal distribution of the indicated variable.

        i: index of the variable we want

        Returns: Pmf