I was trying to make a sub totals and grand totals for a data. But some where i stuck and couldn't make my deserved output. Could you please assist on this.
data.groupby(['Column4', 'Column5'])['Column1'].count()
Current Output:
Column4 Column5
2018-05-19 Duplicate 220
Informative 3
2018-05-20 Actionable 5
Duplicate 270
Informative 859
Non-actionable 2
2018-05-21 Actionable 8
Duplicate 295
Informative 17
2018-05-22 Actionable 10
Duplicate 424
Informative 36
2018-05-23 Actionable 8
Duplicate 157
Informative 3
2018-05-24 Actionable 5
Duplicate 78
Informative 3
2018-05-25 Actionable 3
Duplicate 80
Expected Output:
Row Labels Actionable Duplicate Informative Non-actionable Grand Total
5/19/2018 219 3 222
5/20/2018 5 270 859 2 1136
5/21/2018 8 295 17 320
5/22/2018 10 424 36 470
5/23/2018 8 157 3 168
5/24/2018 5 78 3 86
5/25/2018 3 80 83
Grand Total 39 1523 921 2 2485
This is a sample data. Could you please have a look with before my ask. I am getting minuted errors. May be i wasn't gave right data. Please kindly check for once. Column1 Column2 Column3 Column4 Column5 Column6 BI Account Subject1 2:12 PM 5/19/2018 Duplicate Name1 PI Account Subject2 1:58 PM 5/19/2018 Actionable Name2 AI Account Subject3 5:01 PM 5/19/2018 Non-Actionable Name3 BI Account Subject4 5:57 PM 5/19/2018 Informative Name4 PI Account Subject5 6:59 PM 5/19/2018 Duplicate Name5 AI Account Subject6 8:07 PM 5/19/2018 Actionable Name1