I have below mentioned different dataframe:
DF1:
Origination_Date Count1 Count2
2018-07-01 147 205
2018-07-05 180 345
2018-07-08 195 247
2018-08-04 205 788
DF2:
Date ID
2018-07-01 I-1
2018-07-02 I-2
2018-07-02 I-3
2018-07-03 I-4
2018-07-03 I-5
2018-08-04 I-6
2018-08-04 I-7
DF3
Create_Date ID
2018-07-01 I-1
2018-07-02 I-2
2018-07-03 I-3
2018-08-04 I-4
2018-08-04 I-5
By utilizing the above multiple dataframe, I want to create a new dataframe group by MonthYear and represent consolidated count on month wise and date wise as shown in the below sample dataframe.
Required Output:
Month Count1 Count2 DF2_Count(ID) DF3_Count(ID)
Aug-18 205 788 2 2
Jul-18 522 797 5 3
Jun-18 0 0 0 0
The above mentioned same data structure want to create on date basis as well, I have tried using group_by function and could create the required dataframe for each separate datafreme but not by consolidated all the dataframe.
Note:
- Though I don't have Jun-18
month in my datframe, I want to create a row for
the same month (want to create atleast three month in the required output
dataframe considering the latest month (i.e if its Sep-18
than Aug-18
and
Jul-18
).
- If any dataframe has 0 row than show count 0 is Required Output.