My data frame includes both float and binary dummy variables. When trying to create a correlation heatmap, the .corr() function creates the correlation matrix only for my binary variables and eliminates the rest. I wonder if there's a reason for this odd behavior and how to fix the problem/use a different package to create correlation matrix.
Here is the codes I use:
# Heatmap
import seaborn as sns
import matplotlib.pyplot as plt
cols_noCluster= df1.columns
df_noCluster = df1[cols_noCluster]
corr = df_noCluster.corr()
f, ax = plt.subplots(figsize=(17, 17))
hm = sns.heatmap(round(corr,2), annot=True, ax=ax, #cmap="coolwarm",
fmt='.2f',linewidths=.05)
bottom, top = ax.get_ylim()
ax.set_ylim(bottom + 0.5, top - 0.5)
f.subplots_adjust(top=0.93)
t= f.suptitle('Correlation Heatmap', fontsize=14)
Thanks