Pandas中散布矩阵的函数原型为:
scatter_matrix(df, alpha=0.5, figsize=None, ax=None, diagonal='hist', marker='.', density_kwds=None,hist_kwds=None, range_padding=0.05, **kwds)
实例:
import pandas as pd
import matplotlib.pyplot as plt
#导入数据
filename = "d:/my_project/input/pima-indians-diabetes.data.csv"
names = ['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'pedi', 'age', 'class']
data = pd.read_csv(filename, names=names)
pd.plotting.scatter_matrix(data)