- scipy.stats.binom_test(x, n=None, p=0.5, alternative='two-sided')¶
Perform a test that the probability of success is p.
This is an exact, two-sided test of the null hypothesis that the probability of success in a Bernoulli experiment is p.
x : integer or array_like
the number of successes, or if x has length 2, it is the number of successes and the number of failures.
n : integer
the number of trials. This is ignored if x gives both the number of successes and failures
p : float, optional
The hypothesized probability of success. 0 <= p <= 1. The default value is p = 0.5
p-value : float
The p-value of the hypothesis test