I have 2 dataframe: df1 and df2,
len(df1)=167
len(df2)=3047
I want to merge df2 into df1,it means the length of new new_df should be the same of df1.
new_df = pd.merge(df1, df2,
on=['header_name'], how="left")
I used:
how=left
I think this is the right way,but I don't know why the length of new_df= 574 it is larger than df1.
The output should be:
len(new_df)=len(df1)