Finding common rows (intersection) in two Pandas dataframes
My understanding is that this question is better answered over in this post. But briefly, the answer to the OP with this method is simply: s1 = pd.merge(df1, df2, how=’inner’, on=[‘user_id’]) Which gives s1 with 5 columns: user_id and the other two columns from each of df1 and df2.