公告
财富商城
积分规则
提问
发文
2019-02-25 21:23发布
We Are One
I would like to create multiple pie chart for each continent to show the alcohol serving with percentage on it.
Thank you
You can use DataFrame.plot.pie with transpose dataframe by T:
DataFrame.plot.pie
T
df = pd.DataFrame({'beer':[1,2,3], 'spirit':[4,5,6], 'wine':[7,8,9]}, index=['Africa','Asia','Europe']) print (df) beer spirit wine Africa 1 4 7 Asia 2 5 8 Europe 3 6 9 df.T.plot.pie(subplots=True, figsize=(10, 3))
最多设置5个标签!
You can use
DataFrame.plot.pie
with transpose dataframe byT
: