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’.