I have two DataFrames as follow:
df1 = pd.DataFrame({'Group1': [0.5,5,3], 'Group2' : [2,.06,0.9]}, index=['Dan','Max','Joe'])
df2 = pd.DataFrame({'Name' : ['Joe','Max'], 'Team' : ['Group2','Group1']})
My goal is to get the right value for the Name of the person considering the the column 'Team'.
So the result should look something like this:
I tried it with a merge but I failed because I don't know how to merge on these conditions.
What's the best way in Python to reach my goal?