How to lookup different dataframes and return the values?
Question:
Answers:
Get the IDs from df2 where the ID is in df1
filtered_df = df2[(df2['ID'].isin(df1['ID']))]
Try this
new_df = df2[df2.ID == [list(df1.ID)]]
Get the IDs from df2 where the ID is in df1
filtered_df = df2[(df2['ID'].isin(df1['ID']))]
Try this
new_df = df2[df2.ID == [list(df1.ID)]]