I saw this page, How to group dataframe rows into list in pandas groupby but, that's not what I need.
Let my datatable example see please.
| index | column1 | column2 |
|---|---|---|
| 0 | apple | red |
| 1 | banana | a |
| 1 | banana | b |
| 2 | grape | wow |
| 2 | grape | that's |
| 2 | grape | great |
| 2 | grape | fruits! |
| 3 | melon | oh |
| 3 | melon | no |
| ...a lot of data... | ...a lot of data... | ... a lot of data... |
and I want to groupby ONLY index 2~3 (I need to range because my real data is hudge.)
so I want to this table
| . | column1 | column2 |
|---|---|---|
| 0 | apple | red |
| 1 | banana | a |
| 1 | banana | b |
| 2 | grape | wow that's great grape fruits! |
| 3 | melon | oh no |
| ...a lot of data... | ...a lot of data... | ... a lot of data... |
How can I get this?