title: How to calculate entropy from frequency table?
body: <p>I have data on a bunch of names (> 10 million) and their associated counts. </p>
  
  <pre><code>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)
  </code></pre>
  
  <pre><code>    Name  Count
  0   Sara     20
  1   John     10
  2   Mark      5
  3  Peter      2
  4   Kate      5
  
  </code></pre>
  
  <p>I want to compute the entropy of the <code>Count</code> column WITHOUT expanding the data to be like <code>[Sara, Sara, Sara,...,Kate, Kate, Kate]</code> because there are just too many observations for that. </p>
  
  <p><strong>How would I compute entropy of <code>Count</code></strong> without expanding the data?</p>