Search for the last occurence in multiple columns in a dataframe,df.stack(level=0).groupby('team').tail(1)