def Conditional(self, i, j, val, name='<STR_LIT>'):
pmf = Pmf(name=name)<EOL>for vs, prob in self.Items():<EOL><INDENT>if vs[j] != val: continue<EOL>pmf.Incr(vs[i], prob)<EOL><DEDENT>pmf.Normalize()<EOL>return pmf<EOL>
Gets the conditional distribution of the indicated variable.

        Distribution of vs[i], conditioned on vs[j] = val.

        i: index of the variable we want
        j: which variable is conditioned on
        val: the value the jth variable has to have

        Returns: Pmf