Imagine I have a dataframe like the following in Ipython:
df = pd.DataFrame({
'A' : ['1', '1', '1', '1','1', '1', '2', '2', '2', '2', '2', '2'],
'B' : ['00:00', '00:10', '00:20', '00:30','01:10', '01:20','00:00', '00:10', '00:20', '00:30','01:10', '01:20',],
'C' : [2,3,4,2,4,5,6,7,1,5,6,4]}
)
what I need is the right side result: which is group by over A and then compute the mean on every 2(n) rows of each group. I need to do it for a very large scale data set with more that 4K groups.
I tried to used Pandas and I think it could be a useful library.