SciPy

prob140.Table.prob_event

Table.prob_event(x)

Finds the probability of an event x

Parameters:

x : float or Iterable

An event represented either as a specific value in the domain or a subset of the domain

Returns:

float

Probability of the event

Examples

>>> dist = Table().values([1,2,3,4]).probability([1/4,1/4,1/4,1/4])
>>> dist.prob_event(2)
0.25
>>> dist.prob_event([2,3])
0.5
>>> dist.prob_event(np.arange(1,5))
1.0