I have two data frame wants to compare some fields between two and if filed found in both the data frame then flag it to true else false. here StoreId And PartyCode is a composite key.
Code:
df1 = DataFrame({'StoreId': [1, 2, 3], 'PartyCode': ['a', 'b', 'c'],'anotherfiled': ['x', 'y', 'z']})
df2 = DataFrame({'StoreId': [1, 5,4], 'PartyCode': ['a', 'b','d']})
df1.isin(df2)