I have data on a bunch of names (> 10 million) and their associated counts.
import pandas as pd
import numpy as np
data = {
"Name": ['Sara', 'John', 'Mark', 'Peter', 'Kate'],
"Count": [20, 10, 5, 2, 5],
}
df = pd.DataFrame(data)
print(df)
Name Count
0 Sara 20
1 John 10
2 Mark 5
3 Peter 2
4 Kate 5
I want to compute the entropy of the Count
column WITHOUT expanding the data to be like [Sara, Sara, Sara,...,Kate, Kate, Kate]
because there are just too many observations for that.
How would I compute entropy of Count
without expanding the data?