Python: Replacing Values using other rows data
Please assist, I have this form of data.
I want to do replacement such that null values in 'Value1' column are duplicated as long the rows have the same 'C_Code' value regardless of any other columns. Same for 'Value2' null values. They can duplicate the non-null value for closest "Year" (not a must). My table has many columns requiring this treatment.
Expected output: