Reputation: 253
I am trying to make a bar graph or a stacked bar graph with the count of each city.
The x-axis should be the the label of cluster and y-axis should be the count.
Something like these
Where the colors are different cities.
I have tried to use the hist funtions from pandas but cannot separate the cities.
Upvotes: 0
Views: 210
Reputation: 20342
I tend to lean towards plotly, in Jupyter, because it's interactive.
https://plotly.com/python/histograms/
https://www.fredlich.com/works/how-to-make-a-countplot-in-seaborn-plotly-and-matplotlib
https://towardsdatascience.com/histograms-with-plotly-express-complete-guide-d483656c5ad7
Also, Seaborn has some nice features too!
https://seaborn.pydata.org/generated/seaborn.countplot.html
Upvotes: 2