I know that plt.hist() method needs x-axis as argument to be plotted.
But I have the following situation:
id cluster_number
1 10
2 21
3 55
4 36
5 70
. .
. .
. .
if I use my_serie = df.groupby('cluster_number')['id'].size(), the output would be a Serie with the number of id's in each cluster.
Then, with plt.plot(my_serie), I get a plot with:
x-axis: number of clusters...y-axis: with a given number ofid's
Of course, this type of data would fit better in a histogram. But plt.hist() will understand the serie given as input as an x-axis values, not y-axis values, as understood by plt.plot():
x-axis: number ofid'sin a cluster...y-axis: and number of clusters with that number ofid'sread inx-axis
How can I get a histogram with x-axis and y-axis arrangement equal to plt.plot()?