Let us say I have the following pandas dataframe:
+---------------------+---------+-------+-----+ | observed_cats_count | year | month | day | +---------------------+---------+-------+-----+ | 2 | 2019 | 10 | 19 | | 3 | 2019 | 10 | 18 | | 5 | 2019 | 10 | 16 | +---------------------+---------+-------+-----+ And two boundary dates, say 2019-10-15 and 2019-10-20, and I know that all missing observations should have observed_cats_count=0.
How can insert a row for all missing dates in the interval and get the following dataframe:
+---------------------+---------+-------+-----+ | observed_cats_count | year | month | day | +---------------------+---------+-------+-----+ | 0 | 2019 | 10 | 20 | | 2 | 2019 | 10 | 19 | | 3 | 2019 | 10 | 18 | | 0 | 2019 | 10 | 17 | | 5 | 2019 | 10 | 16 | | 0 | 2019 | 10 | 15 | +---------------------+---------+-------+-----+