title: Count of all possible combinations between dataframe columns
body: <p>I'm trying to get the count (where all row values are 1) of each possible combination between the eight columns of a dataframe. Basically I need to understand how many times different overlaps exist.</p>
  
  <p>I've tried to use <code>itertools.product</code> to get all the combinations, but it doesn't seem to work.</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import itertools
  
  df = pd.read_excel('filename.xlsx')
  
  df.head(15)
  
      a   b   c   d   e   f   g   h
  0   1   0   0   0   0   1   0   0
  1   1   0   0   0   0   0   0   0
  2   1   0   1   1   1   1   1   1
  3   1   0   1   1   0   1   1   1
  4   1   0   0   0   0   0   0   0
  5   0   1   0   0   1   1   1   1
  6   1   1   0   0   1   1   1   1
  7   1   1   1   1   1   1   1   1
  8   1   1   0   0   1   1   0   0
  9   1   1   1   0   1   0   1   0
  10  1   1   1   0   1   1   0   0
  11  1   0   0   0   0   1   0   0
  12  1   1   1   1   1   1   1   1
  13  1   1   1   1   1   1   1   1
  14  0   1   1   1   1   1   1   0
  
  
  print(list(itertools.product(new_df.columns)))
  
  </code></pre>
  
  <p>The expected output would be a dataframe with the count (n) of rows for each of valid combinations (where values in the row are all 1).</p>
  
  <p>For example:</p>
  
  <pre><code>    a   b
  0   1   0   
  1   1   0   
  2   1   0   
  3   1   0   
  4   1   0   
  5   0   1   
  6   1   1   
  7   1   1   
  8   1   1   
  9   1   1   
  10  1   1   
  11  1   0   
  12  1   1   
  13  1   1   
  14  0   1
  </code></pre>
  
  <p>Would give</p>
  
  <pre><code>combination   count
  
  a              12
  a_b             7
  b               9
  </code></pre>
  
  <p>Note that the output would need to contain all the combinations possible between <code>a</code> and <code>h</code>, not just pairwise</p>