categorical data in correlation matrix?
I'm getting an error for categorial data being in the df_agg dataset and the correlation matrix is not able to be created with the code shown. Anyone else having this error?
2 answers ( 0 marked as helpful)
Answered my own question somewhat. There is a total row that is counting as a string. I did df_agg.drop(index=0) and was able to run the matrix. But wasn't able to make it last to run the next line.
we need to drop the following colums, after that it shows correlation matrix.
df_agg_cor = df_agg.drop(['Video','Video title','Video publish time','Average view duration','rev_buckets'], axis=1)
df_agg_cor
corre = df_agg_cor.corr()
sns.heatmap(corre)