Home > Mobile >  Barplot by month - python
Barplot by month - python

Time:10-28

I am trying to do two bar plot (Descending order) in python with following criteria,

1- observations by month with total count.

2- observations by month with value A > 0.

I am struggling to create this in python.

enter image description here

CodePudding user response:

IIUC, you a can try this:

df.groupby('month', sort=False)['value A'].agg(['sum', 'count']).plot.bar()

Output:

enter image description here

  • Related