Suppose I have the following DataFrame
dic = {"Date": ["04-Jan-16", "04-Jan-16", "04-Jan-16", "05-Jan-16", "05-Jan-16"], "Col": ['A', 'A', 'B', 'A', 'B']} df = pd.DataFrame(dic) df Col Date 0 A 04-Jan-16 1 A 04-Jan-16 2 B 04-Jan-16 3 A 05-Jan-16 4 B 05-Jan-16
I need to return a second DataFrame that lists the number of occurrences of A and B per day. i.e.
AB Date 04-Jan-16 2 1 05-Jan-16 1 1
I have a feeling that this concerns "groupby", but I donโt know enough about it to get it in the format above ^
source share