Getting the max value

I have a sample file attached. I have written the following code to load it in a dataframe.


import pandas as pd

my_path=r'C:\Users\Documents\Sample File.xlsx'
data={}

df1 = pd.read_excel(my_path,sheet_name='Sheet1',dtype=str,index_col=None)

I would like to add a column to this dataframe called Output Column. This column should find the Max Value of the ‘Value’ column grouped by Col1 and Col2 and return the corresponding Col3 value. For example for rows 2, 10 and 14 the output should be ‘Value 13’. For rows 7 and 9, the output should be ‘Value 6’.

I do not see an attached file.

I am not sure how much of what you are saying you are asking for help with.

Perhaps something like:

df1['OutputColumn'] = ????

I have an image of my input Excel file attached above. In the above Python code, I am reading this file into a dataframe. I want to add a new column(Output Column) to the dataframe as per the criteria mentioned.