I've already checked out Add missing dates to pandas dataframe, but I don't want to fill in the new dates with a generic value.
My dataframe looks more or less like this:
date (dd/mm/yyyy) | value |
---|---|
01/01/2000 | a |
02/01/2000 | b |
03/01/2000 | c |
06/01/2000 | d |
So in this example, days 04/01/2000 and 05/01/2000 are missing. What I want to do is to insert them before the 6th, with a value of c, the last value before the missing days. So the "correct" df should look like:
date (dd/mm/yyyy) | value |
---|---|
01/01/2000 | a |
02/01/2000 | b |
03/01/2000 | c |
04/01/2000 | c |
05/01/2000 | c |
06/01/2000 | d |
There are multiple instances of missing dates, and it's a large df (~9000 rows).
Thanks for your time! :)