Applied Data Analysis in Python

In [1]:
from pandas import DataFrame
from sklearn.datasets import load_iris

iris, iris_target = load_iris(as_frame=True, return_X_y=True)
iris.head()
Out[1]:
sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)
0 5.1 3.5 1.4 0.2
1 4.9 3.0 1.4 0.2
2 4.7 3.2 1.3 0.2
3 4.6 3.1 1.5 0.2
4 5.0 3.6 1.4 0.2
In [2]:
corr = iris.corr()
In [3]:
%matplotlib inline

import seaborn as sns

sns.heatmap(corr, vmin=-1.0, vmax=1.0, cmap="RdBu")
Out[3]:
<AxesSubplot: >
No description has been provided for this image
In [4]:
from pandas.plotting import scatter_matrix

a = scatter_matrix(iris, figsize=(16, 16), c=iris_target)
No description has been provided for this image