Python笔记:雷达图
import pandas as pd from pyecharts import options as opts from pyecharts.charts import Radar df1=ts.get_hist_data('600132',start='2018-01-03',end='2018-01-03')#获取2018-01-03的600132股票数据 name=list(df1)#获取列名 v1=[list(df1.ix[0])] df2=ts.get_hist_data('600132',start='2018-01-02',end='2018-01-02')#获取2018-01-02的600132股票数据 v2=[list(df2.ix[0])] df=pd.concat([df1,df2],axis=0) up=list(df.describe().ix['max']*1.1)#设置上限 c = ( Radar() .add_schema( schema=[ opts.RadarIndicatorItem(name=name[i], max_=up[i]) for i in range(len(name)) ] ) .add("2018-01-03", v1) .add("2018-01-02", v2,color="#0004a1") .set_series