4
这就是我现在所拥有的:如何绘制小地块在大熊猫
np.random.seed(1234)
test = pd.DataFrame({'week':[1,1,1,1,1,1,2,2,2,2,2,2],
'score':np.random.uniform(0,1,12),
'type': [0,1,0,1,0,1,0,1,0,1,0,1],
'type2':[3,3,4,4,5,5,3,3,4,4,5,5]})
test.groupby(['week','type','type2']).agg('sum').unstack().plot(kind='bar')
如何绘制方面基于“型”?我想两个不同的地块,一个用于type = 1和另一种类型= 2
你可能看看seaborn(基于熊猫和matplotlib)http://stanford.edu/~mwaskom/software/seaborn/tutorial/axis_grids.html – JohnE