例如,我有一个名为Category的专栏,在该专栏下我有家具、办公用品和技术。我想绘制另一个名为Sub Category的列,但在绘制时我遇到了一个问题。我想绘制子类别列,它的值与类别列平行,但我得到的是子类别列中所有值的单个绘图。 让我来描述一下:
superstore = pd.read_csv('SampleSuperstore.csv')
superstore.head()
superstore.groupby(['Category', 'Sub-Category']).size()
我试过这个代码来进行绘图
sns.catplot(x='Category', y='Profit', hue='Sub-Category', data=superstore, kind='bar', aspect=4)
我想分别绘制家具、办公用品和技术的子类别。 每个类别和相应子类别的单独绘图
目前没有回答
相关问题 更多 >
编程相关推荐