-
-
Save amankharwal/fc9ad0e739ec342d8aa19accb3254ff4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
movies = pd.read_csv("MoviesOnStreamingPlatforms_updated.csv") | |
movies['Rotten Tomatoes'] = movies["Rotten Tomatoes"].str.replace("%", "").astype(float) | |
movies.drop("Type", inplace=True, axis=1) | |
correlations = movies.corr(method='pearson') | |
# Correlation Between All The Features | |
print(correlations) | |
# Correlation Between A Particular column "Year" | |
print(correlations["Year"]) | |
# Visualizing Correlation | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
sns.heatmap(correlations) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment