

def conditional_distribution(self, values, inplace=True):
    "\n        Returns Conditional Probability Distribution after setting values to 1.\n\n        Parameters\n        ----------\n        values: list or array_like\n            A list of tuples of the form (variable_name, variable_state).\n            The values on which to condition the Joint Probability Distribution.\n        inplace: Boolean (default True)\n            If False returns a new instance of JointProbabilityDistribution\n\n        Examples\n        --------\n        >>> import numpy as np\n        >>> from pgmpy.factors import JointProbabilityDistribution\n        >>> prob = JointProbabilityDistribution(['x1', 'x2', 'x3'], [2, 2, 2], np.ones(8)/8)\n        >>> prob.conditional_distribution([('x1', 1)])\n        >>> print(prob)\n        x2    x3      P(x2,x3)\n        ----  ----  ----------\n        x2_0  x3_0      0.2500\n        x2_0  x3_1      0.2500\n        x2_1  x3_0      0.2500\n        x2_1  x3_1      0.2500\n        "
    JPD = (self if inplace else self.copy())
    JPD.reduce(values)
    JPD.normalize()
    if (not self):
        return JPD

dataset/ETHPy150Open pgmpy/pgmpy/pgmpy/factors/JointProbabilityDistribution.py JointProbabilityDistribution.conditional_distribution/VarMisuse@48/387 `inplace`->`self`