I have a DataFrame looking like:
| gap_id | species | time_start | time_stop |
|---|---|---|---|
| 1 | wheat | 2021-11-22 00:01:00 | 2021-11-22 00:03:00 |
| 2 | fescue | 2021-12-18 05:52:00 | 2021-12-18 05:53:00 |
I would like to expand the DataFrame such that I get as many rows as the number of minutes between time_start and time_stop for each gap_id:
| gap_id | species | time |
|---|---|---|
| 1 | wheat | 2021-11-22 00:01:00 |
| 1 | wheat | 2021-11-22 00:02:00 |
| 1 | wheat | 2021-11-22 00:03:00 |
| 2 | fescue | 2021-12-18 05:52:00 |
| 2 | fescue | 2021-12-18 05:53:00 |
I've tried the method pd.data_range but I don't know how to couple it with a groupby made on gap_id
Thanks in advance