I want to add missing rows based on the column "id" in a dataframe. The id should be continuous integers, starting from 1 to 60000. A small example is as follows: id ranges from 1 to 5. So I need to add 1,3,4 with value "0"s for the table below.
| id | value1 | value2 |
|---|---|---|
| 2 | 13 | 33 |
| 5 | 45 | 24 |
The final dataframe would become
| id | value1 | value2 |
|---|---|---|
| 1 | 0 | 0 |
| 2 | 13 | 33 |
| 3 | 0 | 0 |
| 4 | 0 | 0 |
| 5 | 45 | 24 |