Sorted bar charts with pandas/matplotlib or seaborn

后端 未结 2 1154
时光说笑
时光说笑 2020-12-10 06:43

I have a dataset of 5000 products with 50 features. One of the column is \'colors\' and there are more than 100 colors in the column. I\'m trying to plot a bar chart to show

2条回答
  •  感情败类
    2020-12-10 06:59

    If you want to use pandas then you can first sort:

    top_colors[:10].sort(ascending=0).plot(kind='barh')
    

    Seaborn already styles your pandas plots, but you can also use:

    sns.barplot(top_colors.index, top_colors.values)
    

提交回复
热议问题