I have a DataFrame like the below, where the Diff column is Value - PreviousValue.
Date Value Diff
2010-01-01 100 Na
2010-02-01 110 10
2010-03-01 130 20
2010-04-01 100 -30
2010-05-01 Na 20
2010-06-01 Na 30
As you can see, some of the Values are missing, even though we have the Diff. I wish to reconstruct the table so that the Values are correct:
Date Value Diff
2010-01-01 100 Na
2010-02-01 110 10
2010-03-01 130 20
2010-04-01 100 -30
2010-05-01 120 20
2010-06-01 150 30
How can this be done?