title: Correlation among multiple categorical variables (Pandas)
body: <p><a href="https://i.stack.imgur.com/OwUgy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OwUgy.png" alt="my original dataset"></a></p>
  
  <p>I have a data set made of 22 <strong>categorical variables</strong> (non-ordered). I would like to visualize their correlation in a nice <strong>heatmap</strong>. Since the Pandas built-in function</p>
  
  <pre><code>DataFrame.corr(method='pearson', min_periods=1)
  </code></pre>
  
  <p>only implement correlation coefficients for numerical variables (Pearson, Kendall, Spearman), I have to aggregate it myself to perform a chi-square or something like it and I am not quite sure which function use to do it in <strong>one elegant step</strong> (rather than iterating through all the cat1*cat2 pairs). To be clear, this is what I would like to end up with (a <strong>dataframe</strong>):  </p>
  
  <pre><code>         cat1  cat2  cat3  
    cat1|  coef  coef  coef  
    cat2|  coef  coef  coef
    cat3|  coef  coef  coef
  </code></pre>
  
  <p>Any ideas with <strong>pd.pivot_table</strong> or something in the same vein?</p>
  
  <p>thanks in advance
  D.</p>