I want to see the correlation of the feature as a table. How can I type the code?
# Correlation matrix between numerical values (SibSp Parch Age and Fare values) and Survived
g = sns.heatmap(train[['person_attribute_a',
'person_attribute_a_1', 'person_attribute_b', 'person_prefer_c',
'person_prefer_d_1', 'person_prefer_d_2', 'person_prefer_d_3',
'person_prefer_e', 'person_prefer_f', 'person_prefer_g',
'person_prefer_h_1', 'person_prefer_h_2', 'person_prefer_h_3',
'contents_attribute_i', 'contents_attribute_a',
'contents_attribute_j_1', 'contents_attribute_j',
'contents_attribute_c', 'contents_attribute_k', 'contents_attribute_l',
'contents_attribute_d', 'contents_attribute_m', 'contents_attribute_e',
'contents_attribute_h', 'person_rn', 'contents_rn','target']].corr(),annot=True, fmt = ".2f", cmap = "coolwarm")
>Solution :
You have provided the answer to your question as well.
To get the correlation of various columns of a dataframe in a table, you can directly use:
df.corr()
