Cumulative sum in Pandas DataFrame based on multiple column value matches between two dataframes I have two Dataframes. Dataframe1(df1): has 4 columns as shown below.