I have a simple dataframe which I would like to bin for every 3 rows.
It looks like this:
col1 0 2 1 1 2 3 3 1 4 0
For Python 2 (2.2+) users, who have "true division" enabled (e.g. by using from __future__ import division), you need to use the "//" operator for "floor division":
from __future__ import division
df.groupby(df.index // 3).mean()