I have a dataframe with 50k rows and two columns, item
and labels
. I want to reduce the number of rows but keep the same values for all labels.
So it looks like:
- Label "notebook": 1000 rows
- Label "ballpoint": 1000 rows
- Label "pencil": 1000 rows
- Label "eraser": 1000 rows
- Label "pencil sharpener": 1000 rows
So from 50k rows, it reduces to only 5000 rows with the same number of rows for each label.