0

I have this dataframe:

enter image description here

I am trying to group by ID and sum of the groups and have to plot:

grps = self.df_G_UI.groupby('Module')['#Runs','#Pass'].sum()
for name, grp in grps:
    if name == selectedMod:
        grp.plot(x=name, y=['#Runs','#Pass'], ax=self.a, kind='bar', color=['Blue', 'Green')

But it is not working.

sneeu
  • 2,602
  • 3
  • 24
  • 27
  • What kind of plot are your expecting ? Also, could you provide a [minimal working example](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) ? – Nathan Furnal Jan 08 '21 at 13:05
  • #grps=self.df_G_UI.groupby('Module')['#Runs','#Pass','#Fail'].sum().reset_index('Module') #for name, grp in grps: # if name == selectedMod: # grp.plot(x=name, y=['#Runs','#Pass','#Fail'], ax=self.a, kind='bar', # – Saravanan S Jan 08 '21 at 14:17

0 Answers0