99 for pattern in suspicious_patterns:
100 if pattern in log:
101 # A suspicious binomial proportion test
102 p = sum(1 for l in logs if pattern in l) / len(logs)103 z = stats.binom_test(k=1, n=len(logs), p=p, alternative="greater")
104
105 # Check if the binomial proportion is statistically significant
Variables named I
, O
, and l
can be very hard to read. This is because the letter I
and the letter l
are easily confused, and the letter O
and the number 0
can be easily confused.
Change the names of these variables to something more descriptive.