class_docstr: Base class for Joint Probability Distribution
class_docstr_tok: ["Base","class","for","Joint","Probability","Distribution"]
docstr: Returns Conditional Probability Distribution after setting values to 1.
  
  Parameters
  ----------
  values: list or array_like
      A list of tuples of the form (variable_name, variable_state).
      The values on which to condition the Joint Probability Distribution.
  inplace: Boolean (default True)
      If False returns a new instance of JointProbabilityDistribution
  
  Examples
  --------
  >>> import numpy as np
  >>> from pgmpy.factors.discrete import JointProbabilityDistribution
  >>> prob = JointProbabilityDistribution(['x1', 'x2', 'x3'], [2, 2, 2], np.ones(8)/8)
  >>> prob.conditional_distribution([('x1', 1)])
  >>> print(prob)
  x2    x3      P(x2,x3)
  ----  ----  ----------
  x2_0  x3_0      0.2500
  x2_0  x3_1      0.2500
  x2_1  x3_0      0.2500
  x2_1  x3_1      0.2500
docstr_tok: ["Returns","Conditional","Probability","Distribution","after","setting","values","to","1",".","Parameters","--","--","--","--","--","values",":","list","or","array_like","A","list","of","tuples","of","the","form","(","variable_name",",","variable_state",")",".","The","values","on","which","to","condition","the","Joint","Probability","Distribution",".","inplace",":","Boolean","(","default","True",")","If","False","returns","a","new","instance","of","JointProbabilityDistribution","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","pgmpy.factors.discrete","import","JointProbabilityDistribution",">",">",">","prob","=","JointProbabilityDistribution","(","[","'x1","'",",","'x2","'",",","'x3","'","]",",","[","2",",","2",",","2","]",",","np.ones","(","8",")","\/8",")",">",">",">","prob.conditional_distribution","(","[","(","'x1","'",",","1",")","]",")",">",">",">","print","(","prob",")","x2","x3","P","(","x2",",","x3",")","--","--","--","--","--","--","--","--","--","x2_0","x3_0","0.2500","x2_0","x3_1","0.2500","x2_1","x3_0","0.2500","x2_1","x3_1","0.2500"]
code: def conditional_distribution(self, values, inplace=True):
      """
      Returns Conditional Probability Distribution after setting values to 1.
  
      Parameters
      ----------
      values: list or array_like
          A list of tuples of the form (variable_name, variable_state).
          The values on which to condition the Joint Probability Distribution.
      inplace: Boolean (default True)
          If False returns a new instance of JointProbabilityDistribution
  
      Examples
      --------
      >>> import numpy as np
      >>> from pgmpy.factors.discrete import JointProbabilityDistribution
      >>> prob = JointProbabilityDistribution(['x1', 'x2', 'x3'], [2, 2, 2], np.ones(8)/8)
      >>> prob.conditional_distribution([('x1', 1)])
      >>> print(prob)
      x2    x3      P(x2,x3)
      ----  ----  ----------
      x2_0  x3_0      0.2500
      x2_0  x3_1      0.2500
      x2_1  x3_0      0.2500
      x2_1  x3_1      0.2500
      """
      JPD = self if inplace else self.copy()
      JPD.reduce(values)
      JPD.normalize()
      if not inplace:
          return JPD
  
file_path: pgmpy/pgmpy/factors/discrete/JointProbabilityDistribution.py
imports: import itertools
  from functools import reduce
  from operator import mul
  import numpy
  from pgmpy.factors.discrete import DiscreteFactor
  from pgmpy.independencies import Independencies
label_desc: Use image node_id 7 for calling the JointProbabilityDistribution obj's underlying member method code with example usage: obj.conditional_distribution(values, inplace) and returns: JPD