赞
踩
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
iris = pd.read_csv('iris.csv')
iris.head()
展示两两特征之间的关系
sns.set(style='ticks')
sns.pairplot(iris,vars=['sepal_length','petal_length','sepal_width','petal_width'])
data = np.array(iris[['sepal_length','petal_length','sepal_width','petal_width']]).tolist()
parallel_axis = [
{"dim":0,"name":"萼片长度"},
{"dim":1,"name":"萼片宽度"},
{"dim":2,"name":"花瓣长度"},
{"dim":3,"name":"花瓣宽度"}
]
parallel = Parallel(init_opts=opts.InitOpts(width="800px",height="600px"))
parallel.add_schema(schema=parallel_axis)
parallel.add('iris平行图',data=data,linestyle_opts=opts.LineStyleOpts(width=2,opacity=0.2))
parallel.render_notebook()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。