title: Pandas: Short summary of data
body: <p>I currently use following function to inspect the distribution of data in a column that contains binary data (Example here <a href="https://pastebin.com/QpWfREYB" rel="nofollow noreferrer">https://pastebin.com/QpWfREYB</a>).</p>
  
  <pre><code>print(pd.value_counts(df['binary']).apply(lambda x: x/len(data['label'])*100))
  
  print(pd.value_counts(df['binary']).apply(lambda x: x))
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>A    65.466667
  B    34.533333
  Name: label, dtype: float64
  A    7856
  B    4144
  Name: label, dtype: int64
  </code></pre>
  
  <p>Is there a simple way to get an output like:</p>
  
  <pre><code>A   7856    (65.67%)
  B   4144    (65.67%)
  Sum 12000   (100.00%)
  </code></pre>
  
  <p>?</p>