copy data between two dataframes in python
If you want to add the data from df1 to df2 you can use pandas.merge. Given that you want to keep all records from df2 and only add data from df1 for the identifiers in df2 you can use the following syntax:
import pandas as pd

pd.merge(df2, df1, how=&quot;left&quot;, on=&quot;id_column&quot;)