say I have the iris
dataset.
data(iris)
There are 150 rows in the dataset.
How can I group_by
the first 50 rows and then group_by
rows 51:100, and then finally group_by
101:150?
Some python code that I am following is using (nothing to do with the iris data):
data.reset_index().assign(groupId = lambda row: row.index // 1000)