Merge two data frames based on common column values in Pandas

后端 未结 3 662
陌清茗
陌清茗 2020-11-27 16:02

How to get merged data frame from two data frames having common column value such that only those rows make merged data frame having common value in a particular column.

3条回答
  •  时光取名叫无心
    2020-11-27 16:35

    If you want to merge two dataframes and you want a merged data frame in which only common values from both data frames will appear then do inner merge.

    import pandas as pd
    
    merged_Frame = pd.merge(df1,df2, on = id,how=inner)
    

提交回复
热议问题