I have pandas data frame with column 'year', 'month' and 'transaction id'. I want to get the transaction count of every month for every year. For ex my data is like:
year: {2015,2015,2015,2016,2016,2017}
month: {1, 1, 2, 2, 2, 1}
tid: {123, 343, 453, 675, 786, 332}
I want to get the output such that for every year I will get the number of transactions per month. For ex for year 2015 I will get the output:
month: [1,2]
count: [2,1]
I used groupby('year'). but after that how I can get the per month transaction count.