Skip to content

Instantly share code, notes, and snippets.

@Jargon4072
Created June 17, 2020 05:47
Show Gist options
  • Save Jargon4072/fd5d8b27c292ddf6679216098559d2c9 to your computer and use it in GitHub Desktop.
Save Jargon4072/fd5d8b27c292ddf6679216098559d2c9 to your computer and use it in GitHub Desktop.
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
df1=pd.read_csv("./x01.csv")
df1.columns=["Index","Brain_weight","Body_weight"]
corr_data = df1.corr() #we are using pandas library's corr() function to find correlation.
print(corr_data)
plt.figure(figsize=(9,5))
sns.set_style('ticks')
sns.heatmap(corr_data, annot=True)
plt.title('Correlation of variables in df1 Data set')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment