code: def Conditional(self, i, j, val, name=''):
          
          pmf = Pmf(name=name)
          for vs, prob in self.Items():
              if vs[j] != val: continue
              pmf.Incr(vs[i], prob)
  
          pmf.Normalize()
          return pmf
docs: 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