count elements in columns pandas


Here is what the above code is Doing:
1. We’re using the .value_counts() method on the ‘a’ column of our df.
2. This method returns a series with the counts of unique values.
3. We’re then using the .plot() method on this series to plot the results.
4. We’re using the kind=’bar’ argument to tell the .plot() method that we want a bar chart.
5. We’re using the title=’Bar chart of column a’ argument to give the plot a title.
6. We’re using the color=’red’ argument to make the bars red.
7. We’re using the figsize=(20,10) argument to make the figure size 20 by 10.