I have a dataset similar to this generated from a file with yearly data
d1 = pd.DataFrame({'category': ['A', 'B', 'C', 'D', 'E', 'F'],
'col': ['20%', '40%', '80%', '40%', '60%', '20%']})
Also, a dataset similar to this is generated using another dataset which is monthly
d2 = pd.DataFrame({'category': ['A', 'B', 'C', 'D', 'E', 'F'],
'20%': ['2.1', '4.1', '6.8', '5.9', '3.4', '5.4'],
'40%': ['1.9', '3.7', '6.1', '4.8', '4.1', '7.2'],
'60%': ['3.1', '4.9', '6.5', '7.1', '7.9', '5.1'],
'80%': ['2.5', '4.5', '5.6', '6.9', '8.4', '7.4']})
I wish to get an output like this, where it returns the value of element from d2 based on the two columns in d1
op = pd.DataFrame({'category': ['A', 'B', 'C', 'D', 'E', 'F'],
'col': ['20%', '40%', '80%', '40%', '60%', '20%'],
'min_value': ['2.1', '3.7', '5.6', '4.8', '7.9', '5.4']})
I am not sure how to do this look up of values