Is there way we can split a row into multiple rows based on an integer cap value? I have a dataframe as below
sys_df = pd.DataFrame([{'dateTime': '2020-11-12 17:45:00', 'timeTakenInSeconds': 650, 'id':'xyz'}])
| Index | dateTime | timeTakenInSeconds | id |
|---|---|---|---|
| 0 | 2020-11-12 17:45:00 | 650 | xyz |
I am trying to split the above row into 3 rows of previous 5 minute intervals like below.
| Index | dateTime | timeTakenInSeconds | id |
|---|---|---|---|
| 0 | 2020-11-12 17:45:00 | 300 | xyz |
| 1 | 2020-11-12 17:40:00 | 300 | xyz |
| 2 | 2020-11-12 17:35:00 | 50 | xyz |
Do we have any pandas builin utils to achieve this?