Pandas - intersection of two data frames based on column entries

前端 未结 1 1006
情深已故
情深已故 2020-12-03 05:30

Suppose I have two DataFrames like so:

>>dfA
             S                      T            prob
0        ! ! !                ! ! ! !   8.1623999e-0         


        
相关标签:
1条回答
  • 2020-12-03 06:01

    You can merge them so:

    s1 = pd.merge(dfA, dfB, how='inner', on=['S', 'T'])
    

    To drop NA rows:

    s1.dropna(inplace=True)
    
    0 讨论(0)
提交回复
热议问题