For example, if I have a dataframe, **df** like this

```
col1 col2 col3
 1     2     34
 11    32    32
 21    62    34
 31    12    31
 13    82    35
 11    32    33
 41    32    33

```

I want to loop 3 times and in each loop I want to take n rows one after another and in the last loop take rest of the rows. So it should take following rows in each loop

loop 1

```
 1     2     34
 11    32    32

```

loop 2

```
21    62    34
 31    12    31

```

loop 3

```
13    82    35
 11    32    33
 41    32    33

```