https://alezinhacris.blogspot.com/2024/01/python-counting-cumulative-occurrences.html
Python: Counting Cumulative Occurrences Of Values In A Pandas Series