October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code block reads the data using pandas and plots the correlation matrix using the pyplot API. This is the same as what we did to plot the heat map in Chapter 2, Getting Started with Basic Plots:
wine_quality = pd.read_csv('winequality.csv', delimiter=';')
corr = wine_quality.corr()
plt.figure(figsize=(12,9))plt.imshow(corr,cmap='hot')plt.colorbar()
plt.title('Correlation Matrix')plt.xticks(range(len(corr)),corr.columns, fontsize=10, fontweight='bold',rotation=45) ...Read now
Unlock full access