如何使用熊猫中的数据绘制饼图
Hi everyone,
I'm relatively new to python. I want to plot a pie chart for department, i.e., how many percent of the employees coming from Sales & Marketing
, Operations
, Technology
, etc...
I'm not sure how to count the total number of employees from respective department first then only fit the data into the pie chart. Any help will be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
pandas.series.value_counts
带有pandas.series.plot.pie
:output:
You can use
pandas.Series.value_counts
withpandas.Series.plot.pie
:Output: