'Python DataFrame - Group By Columns with Nan Count

I have some report data which is viewed by user regularly. I want to do group by yearly and monthly aggregation count as below

Raw Data

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source