x连续变量 y 分类变量 logit图 手工分箱
from woe import WoE
woe = WoE(v_type='d')
woe.fit(auto.age_group,auto.Loss)
fig = woe.plot([8,5])
plt.show(fig)
地图统计
from pyecharts import Map
gdp_data = list(zip(gdp[gdp.Year == 2014].loc[:,'Prov'],gdp[gdp.Year == 2014].loc[:,'GDP']))
attr, value = Map.cast(gdp_data)
GDP_max = gdp[gdp.Year == 2014].GDP.max()
GDP_min = gdp[gdp.Year == 2014].GDP.min()
map = Map('各省GDP', width = 1200, height = 600)
map.add('', attr, value, maptype = 'china', is_visualmap = True, visual_range=[GDP_min, GDP_max],
visual_text_color = '#000', is_label_show = True)
map.render()
from pyecharts import Map
snd_price = list(zip(snd.price.groupby(snd.district).mean().index,
snd.price.groupby(snd.district).mean().value