Add Missing Date Index with default values
1
I have a pandas dataframe with an index representing the data (in monthly format) and multiple columns with numeric data. Min Example is below: dict1 = [{'var0': 45, 'var1': 3, 'var2': 2}, {'var0': 32, 'var1': 4, 'var2': 4}, {'var0': 23, 'var1': 5, 'var2': 8}, {'var0': 22, 'var1': 2, 'var2': 12},] df = pd.DataFrame(dict1, index=['2016-08', '2016-09','2016-11','2016-12']) Some of the months are missing however, that is, notice how the index jumps from Sep to Nov. I would like to fill all of the missing months such that the new dataframe contains additional rows with that month as an index and zeros in the respective row, that is: dict1 = [{'var0': 45,...