Im trying to lookup the index in two different datframes and return the values.
For example, in df1 i would like to lookup in df2 and return the same index and values.
I would like my result to be like this.
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)]]