Zipf’s Law in Python

In this post I will write a project in Python to apply Zipf's Law to analysing word frequencies in a piece of text.

Zipf's Law describes a probability distribution where each frequency is the reciprocal of its rank multiplied by the highest frequency. Therefore the second highest frequency is the highest multiplied by 1/2, the third highest is the highest multiplied by 1/3 and so on.

This is best illustrated with a graph.

Zipf's Law in Python

Continue reading