I am trying to compare information into DataFrame. For example I've two bases like this :
data1={'name':['Paul','John','Mike','Sarah','Joe'],'class':[6,5,6,4,6],'sport':['tennis','baseball','basket','basket','tennis']}
base1 = pandas.DataFrame(data=data1)
data2={'name':['Paul','John','Lena','Sarah','Nicolas'],'class':[5,4,6,3,5],'sport':['tennis','baseball','basket','basket','tennis']}
base2 = pandas.DataFrame(data=data2)
I want to retrieve who is still present at next year (e.g. here Paul, John) and even set a condition (e.g who was starting at class 6 followed at class 5, ...)
Do I need to parse on base1 one by one entries to test if it's present in base 2 at next year ? Or is there a more efficient solution ? Best regards and many thanks.