from matplotlib import pyplot as plt
# get count of categorical values
counts = df2021['Regional indicator'].value_counts()
# make a bar plot (you can use some other plot, too)
plt.bar(counts.index, counts)
# make your xticks clearly visible (you can try different angles)
plt.xticks(rotation=90)
plt.show()
1条答案
按热度按时间5lwkijsr1#
你可以使用
value_counts
方法: