0
I would like to drop in lines where the column 1 is duplicated and column 2 is null. I expect an output that way
Col1 Col2
A 123
A NaN
B NaN
B 456
Exit
Col1 Col2
A 123
B 456
I tried to do more or less like this: It will be possible to do this type of Line Drop
df2 = df[df.duplicated('Col1')] and df[df['Col2'].isnull()]
I can’t drop all the values
null
ofCol2
, only those that are repeated inCol1
. For there may be some value inCol1
which is not duplicated and which isnull
inCol2
, these I wish to keep– Luciano Amaro