I have a dataframe that contains a column representing the 'Year' and another column that represents 'Type':
a Year Creams
1 2004 11
2 2004 12
3 2001 13
4 2004 14
5 2002 15
. .... ..
How do I count every year in column 'Year' so it appears as:
a Year TypeCount
1 2004 3
2 2002 1
3 2001 1
It can be output into another dataframe, I don't mind. I just need it to be suitable to make a graph out of it at the end.