I have three columns in a DataFrame. I want to take the number in the Streak_Count column and sum up that number of cells from the returns in the MON TOTAL. The result is displayed in the WANTED RESULT as shown below. The issue I cant figure out is summing the number of cells which can be any number>> in this example between 1 and 4.
MON TOTAL STREAK_COUNT WANTED RESULT
1/2/1992 1.123077 1 1.123077 (only 1 so 1.12)
2/3/1992 -1.296718 0
3/2/1992 -6.355612 2 -7.65233 (sum of -1.29 and -6.35)
4/1/1992 5.634692 0
5/1/1992 4.180605 2 9.815297 (sum of 5.63 and 4.18)
7/1/1992 -0.101016 0
8/3/1992 -0.706125 2 -0.807141 (sum of -.10 and -.706)
10/1/1992 0.368579 0
11/2/1992 3.822277 0
1/4/1993 2.233359 0
2/1/1993 15.219644 4 21.643859
3/1/1993 -2.647693 1 -2.647693
4/1/1993 1.599094 1 1.599094