# openmc.stats.Discrete¶

class openmc.stats.Discrete(x, p)[source]

Distribution characterized by a probability mass function.

The Discrete distribution assigns probability values to discrete values of a random variable, rather than expressing the distribution as a continuous random variable.

Parameters: x (Iterable of float) – Values of the random variable p (Iterable of float) – Discrete probability for each value x (Iterable of float) – Values of the random variable p (Iterable of float) – Discrete probability for each value
classmethod from_xml_element(elem)[source]

Generate discrete distribution from an XML element

Parameters: elem (xml.etree.ElementTree.Element) – XML element Discrete distribution generated from XML element openmc.stats.Discrete
to_xml_element(element_name)[source]

Return XML representation of the discrete distribution

Parameters: element_name (str) – XML element name element – XML element containing discrete distribution data xml.etree.ElementTree.Element