I’ve a lot of DataFrames with 2 columns, like this:
| Fecha | unidades | |
|---|---|---|
| 0 | 2020-01-01 | 2.0 |
| 84048 | 2020-09-01 | 4.0 |
| 149445 | 2020-10-01 | 11.0 |
| 532541 | 2020-11-01 | 4.0 |
| 660659 | 2020-12-01 | 2.0 |
| 1515682 | 2021-03-01 | 9.0 |
| 1563644 | 2021-04-01 | 2.0 |
| 1759823 | 2021-05-01 | 1.0 |
| 2226586 | 2021-07-01 | 1.0 |
As it can be seen, there are some months that are missing. Missing data depends on the DataFrame, I can have 2 months, 10, 100% complete, only one...I need to complete column "Fecha" with missing months (from 2020-01-01 to 2021-12-01) and when date is added into "Fecha", add "0" value to "unidades" column.
Each element in Fecha Column is a class 'pandas._libs.tslibs.timestamps.Timestamp
How could I fill the missing dates for each DataFrame??