pandas 散布矩阵

from sklearn.datasets import load_iris
data = load_iris()  # 获得iris数据集
data.keys()
data['data']
data['target']
data['target_names']
data['feature_names']
data['DESCR']
print(data['DESCR']

import pandas as pd

df=pd.DataFrame(data['data'])  # 转换为dataframe
df.columns=[data['feature_names']]  # 设置列名

pd.plotting.scatter_matrix(df, alpha=0.7, figsize=(14,8), diagonal='kde')

你可能感兴趣的:(pandas)