Why is df.corr() giving “ValueError: could not convert string to float” ?
Puhar, also called Kaveripoompattinam, served as the chief port of the Cholas. Korkai was the principal harbor for the Pandyas, while the Chera kingdom relied on key ports such as Tondi and Muchiri for trade and commerce.
Puhar, also called Kaveripoompattinam, served as the chief port of the Cholas. Korkai was the principal harbor for the Pandyas, while the Chera kingdom relied on key ports such as Tondi and Muchiri for trade and commerce.
See less

To get rid of this error use: numeric_only=True df.corr(numeric_only=True) This is ignoring the columns that are 'object' type while calculating correlation.
To get rid of this error use: numeric_only=True
This is ignoring the columns that are ‘object’ type while calculating correlation.
See less