I am working on pandas dataframe (df) having below sample data:
0 Dec-16 N
1 Jan-17 N
2 Feb-17 Y
3 Feb-17 N
4 Jan-17 N
5 Mar-17 Y
6 Mar-17 Y
7 Jan-17 N
8 Jan-17 Y
using
df_group = df.groupby(['MMM-YY', 'Valid'])
I am getting below output:
MMM-YY Valid
Dec-16 N 1
Feb-17 N 1
Y 1
Jan-17 N 3
Y 1
Mar-17 Y 2
I want to create a bar chart (displaying the bars in %age for Y & N) using this data but unfortunately unable to achieve that. I tried to convert the above output to a new dataframe but no luck.
Any pointers for resolving this would be really appreciated.