Summing over the values of a dict
The formula for calculating entropy is:

$$ \sum_i p_i \log\frac{1}{p_i} $$

or \$-\sum p_i \log p_i\$. It would be nice if the code could express that.

probabilities = [f / 10 for f in frequencies.values() if f &gt; 0]
column_entropy = -sum(p * log(p, 2) for p in probabilities)


The second line is the goal — it's a direct translation of the formula.  The first line is the setup that makes it possible to write the second line nicely.