I have a dataframe that looks like this:
| Part | Date |
|---|---|
| 1 | 9/1/2021 |
| 1 | 9/8/2021 |
| 1 | 9/15/2021 |
| 2 | 9/1/2020 |
| 2 | 9/1/2021 |
| 2 | 9/1/2022 |
The dataframe is already sorted by part, then by date.
I am trying to find the average days between each date grouped by the Part column.
So the desired output would be:
| Part | Avg Days |
|---|---|
| 1 | 7 |
| 2 | 365 |
How would you go about processing this data to achieve the desired output?