I guess this has been covered already, but I can't seem to find this information on the post for merging and joining pandas (Pandas Merging 101)
I basically have 2 PANDAS and would like to merge them based on their matching records only. For instance :
Let's assume I have those 2 dataframes :
df1:
AQROUTES_3 ... Indice de performance
0 Autoroute15 ... 0.696118
1 AvenuedAnjou ... 1.954598
2 AvenuedAnjou ... 1.632500
3 AvenuedAnjou ... 1.831760
4 RangSaint_Andre ... 1.350640
5 AvenuedePicardie ... 2408.779
df2:
FID AQROUTES_3 ... BEARING E_ID
751 751 AvenuedAnjou ... 156.554001 Anjou5
723 723 AvenuedAnjou ... 156.554001 Anjou10
692 692 AvenuedAnjou ... 156.554001 Anjou15
12 12 RangSaint_Andre ... 140.352997 SaintA10
1141 1141 AvenuedePicardie ... 359.289001 Picardi5
I would like to merge them together (merging df1 to df2, thus adding df1's data in df2) while only keeping the matching records such that the output dataframe would be :
FID AQROUTES_3 ... BEARING E_ID Indice de performance
751 751 AvenuedAnjou ... 156.554001 Anjou5 1.954598
723 723 AvenuedAnjou ... 156.554001 Anjou10 1.632500
692 692 AvenuedAnjou ... 156.554001 Anjou15 1.831760
12 12 RangSaint_Andre ... 140.352997 SaintA10 1.350640
1141 1141 AvenuedePicardie ... 359.289001 Picardi5 2408.779
Note that the first entry of df1 (Autoroute15) has not been merged since the record did not find a match in df2.AQROUTES_3
Once again thanks for the help!