gpt4 book ai didi

pandas - 如何旋转 pandas 中的数据框条形图?

转载 作者:行者123 更新时间:2023-12-03 08:21:01 32 4
gpt4 key购买 nike

我找到了这个图,我想旋转它。我的目标是使条形位于垂直轴上。 类似于第二个情节。

plot = pd.DataFrame(data.groupby(['LIFESTAGE', 'PREMIUM_CUSTOMER']).TOT_SALES.sum()) 

plot.unstack().plot(kind = 'bar', stacked = True, figsize = (12, 7), title = 'Total Sales by Customer Segment')

enter image description here

enter image description here

最佳答案

关于pandas - 如何旋转 pandas 中的数据框条形图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67829902/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com