I'm trying to plot a correlation graph with the dataset.I have written the following function for the same
def plot_corr(diabetes_df,size=11):
corr=diabetes_df.corr()
fig, ax= plt.subplots(figsize=(size,size))
ax.matshow(corr)
plt.xticks(range(len(corr.columns),corr.columns))
plt.yticks(range(len(corr.columns),corr.columns))
when this gets executed
I'm thrown an error Getting TypeError: 'Index' object cannot be interpreted as an integer Error
after that a graph get printed with no column ways. Can anyone correct me where I went wrong. Thanks in advance
In case someone wants to review the whole code https://www.kaggle.com/code/akhilkrishnathinna/diabetes-ml-model/edit