I have a data set made of 22 categorical variables (non-ordered). I would like to visualize their correlation in a nice heatmap. Since the Pandas built-in function
DataFrame.corr(method='pearson', min_periods=1)
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 one elegant step (rather than iterating through all the cat1*cat2 pairs). To be clear, this is what I would like to end up with (a dataframe):
cat1 cat2 cat3
cat1| coef coef coef
cat2| coef coef coef
cat3| coef coef coef
Any ideas with pd.pivot_table or something in the same vein?