I'm new into python but and already spent a lot of time without any visible progress on this issue. hope someone could direct me on my question! i have some track data with samples collected.
| track | direction | samples |
|---|---|---|
| 1 | forward | 11 |
| 1 | backward | 10 |
| 2 | forward | 40 |
| 2 | backward | 30 |
and i need to populate dataframe with multiplied number of rows for each direction for each track by number in the column "samples"
the output should be something like that:
| track | direction | sample |
|---|---|---|
| 1 | forward | 1 |
| 1 | forward | 2 |
| 1 | forward | 3 |
| 1 | forward | ... |
| 1 | forward | 11 |
| 1 | backward | 1 |
| 1 | backward | ... |
| 1 | backward | 10 |
| 2 | forward | 1 |
| 2 | forward | ... |
| 2 | forward | 40 |
| 2 | backward | 1 |
| 2 | backward | ... |
| 2 | backward | 30 |
thank you in advance!