I have a data frame with multiple rows per id, similar to this:
| id | amount |
|---|---|
| 1 | 21 |
| 1 | 2 |
| 1 | 3 |
| 2 | 66 |
| 2 | 22 |
| 3 | 10 |
| 3 | 11 |
| 3 | 12 |
| 3 | 13 |
| 3 | 14 |
| 3 | 15 |
| 3 | 16 |
| 3 | 17 |
I would now like to add more rows to each id, until every id has 8 rows in total. The amount in the added rows should be zero. So, f.e., for 1 it would look like this:
| id | amount |
|---|---|
| 1 | 21 |
| 1 | 2 |
| 1 | 3 |
| 1 | 0 |
| 1 | 0 |
| 1 | 0 |
| 1 | 0 |
| 1 | 0 |
How can I achieve this? Thanks in advance!