I have a dataframe which columns look like actor | object | group | phone | day, i want to obtain a vector (or other name, i'm new to python) for each actor that counts how many times that actor appeared by day. The vector should be just the count by day.
The initial data in in a pandas dataframe and looks like this:
actor object group phone Day
john don saf 9234... 27-06-2015
Something like this: John (2,0,8,2,2,3,0,0,2,1,5,3,3,0,0...) I want every day to appear even if that actor doesn´t appear in that day, the count should be 0 in that case. I've tried many ways but never manage to get this.
The output intended is:
Actor (data day 1) (data day 2) (data day 3) (data day 4)
john 2 2 0 3 ...
or
john (2,2,0,3,...)
the important ideia is to get for each actor the ammount of times ir appears in the inicial data for each day.