Home > Back-end >  completing a sparse timeline
completing a sparse timeline

Time:01-07

I have some sparse measurements of process status over time, looking like this:

               tag
2022-01-15  
2022-01-08  #Step3
2022-01-06  #Step2
2021-12-31  
2021-12-28  #Step1

... and I would like to transform them into a complete series that I can use to plot a timeline, looking like this:

               tag
2021-12-28  #Step1
2021-12-29  #Step1
2021-12-30  #Step1
2021-12-31  #Step1
2022-01-01  #Step1
2022-01-02  #Step1
2022-01-03  #Step1
2022-01-04  #Step1
2022-01-05  #Step1
2022-01-06  #Step2
2022-01-07  #Step2
2022-01-08  #Step3
2022-01-09  #Step3
2022-01-10  #Step3
2022-01-11  #Step3
2022-01-12  #Step3
2022-01-13  #Step3
2022-01-14  #Step3
2022-01-15  #Step3

The code below works, but it looks pretty ugly

  •  Tags:  
  • Related