• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: how to plot pie chart using data in pandas

Resolved: how to plot pie chart using data in pandas

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

enter image description here
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!

Answer:

You can use pandas.Series.value_counts with pandas.Series.plot.pie:
Output:
enter image description here

If you have better answer, please add a comment about this, thank you!

jupyter-notebook pandas pie-chart
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Java Swing center JLabel in JPanel with two JLabels

27/03/2023

Resolved: How to compare two text files and and change the sign of the data in powershell?

27/03/2023

Resolved: Java Virtual Machines deleted

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.