Reputation: 47
everyone! I'm trying to make a pie chart from a pandas df but they're all from different columns. Here's what I have:
I'd like to have a pie where each slice is the approve, disapprove or none column. Any suggestions?
Upvotes: 1
Views: 460
Reputation: 14949
IIUC, you can try:
import pandas as pd
df = pd.DataFrame({
'Issue': ['Issue1', 'Issue2', 'Issue3', 'Issue4'],
'Approve': [52, 49, 48, 47],
'Disapprove': [40, 51, 60, 34],
'None': [7, 8, 9, 10],
})
df.set_index('Issue').plot.pie(subplots=True, figsize=(20, 10))
OUTPUT:
Upvotes: 1