Last answered:

02 Jul 2024

Posted on:

19 Sept 2023

0

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)
Posted on:

19 Sept 2023

0

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.


Posted on:

02 Jul 2024

0

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)

Submit an answer