I have 3 columns ID ,Week_number and value as shown below:
What I am trying to do is to create a new column that has null values replaced with the most recent value(based on the week number) for each ID.
for example for ID AP:
The 1st lastest week with a value is week 33 and week 35 and 36 are null so I want the null values for week 35 and 36 to be replace with week 33 value which is 0.97629
ID AP has value for week 37 and null for week 38, so I want to replace the null value for week 38 with 0.98000
I have no clue on how to achieve this.
Appreciate the help.
Thanks in advance!