Pandas cannot compute isin with a duplicate axis

后端 未结 1 493
感动是毒
感动是毒 2021-01-16 06:27

My dataframe is something like this:

             userid           codeassigned         timestamp
15           553938              M1           1499371200000         


        
相关标签:
1条回答
  • 2021-01-16 06:42

    You need merge for inner join with filtered subset:

    subset_df = df.loc[~mask, ['userid', 'timestamp']]
    
    df = subset_df.merge(df)
    

    Or:

    df = subset_df[['userid', 'timestamp']].merge(df)
    
    0 讨论(0)
提交回复
热议问题