I have the below dataframe:
>>>df
Name Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
A 0 1 2 3 4 5 6 7 8 9 1 2
B 3 4 5 6 7 8 9 1 2 4 5 6
C 7 8 9 1 2 3 4 5 6 7 8 9
D 1 2 3 4 5 6 7 8 9 2 3 4
I am trying to create a monthly report where i need only those number which start from Jan till current month and Jan till last month. So effectively, there should be two columns in the output:
Current Month: May
>>>df_output:
Name Jan:May Jan:April
A 10 6
B 25 18
C 27 25
D 15 10
How do i achieve that? The output column names are not specific, can be changed.