The two data frames are given below:
df1
Start Date End Date
0 20110706 20110803
1 20110803 20110907
df2
DATE 50 51 52 53 54
0 20110706 3.51 2.51 1.51 0.51 0
1 20110801 10.98 9.98 8.98 7.98 6.98
2 20110808 9.45 8.45 7.45 6.45 5.45
3 20110906 0 1 23.2 0 1.2
Based off of df1, How can I modify df2 so columns are summed based off the range the dates fall within df1 start date(left inclusive).
Modified df2 dates being left inclusive.(with start date and end date range included in the df)
Start Date End Date 50 51 52 53 54
0 20110706 20110803 14.49 12.49 10.49 8.49 6.98
1 20110803 20110907 9.45 9.45 30.65 6.45 6.65
How can this be accomplished?
DATEkey in df2 such that it is within the Start/End Date range?excelare you wanting an answer specific to excel or pandas?