Question:I have two dataframes representing two monthly datasets. I am trying to roll back the values in
df1(current month) with the values in
df2(previous month) if the value in
Y. The actual dataset is thousands of records long and there are 30 or so columns that need to be reset/rolled back. The double for loops in the code below return null values in
My expected output for
Answer:If I understood you right:
If you have better answer, please add a comment about this, thank you!