I have a dataframe with 3 columns. I would like to drop duplicates in column A based on values in other columns. I have searched tirelessly and cant find a solution like this.
example:
You were not very clear. I suspect you want to drop any duplicates in column A if both columns B and C are NaN. If so, please try;
df[~(df.A.duplicated(keep=False)&(df.B.isna()&df.C.isna()))]
1.4m articles
1.4m replys
5 comments
57.0k users