Drop duplicate if the value in another column is null - Pandas
问题 What I have: df Name |Vehicle Dave |Car Mark |Bike Steve|Car Dave | Steve| I want to drop duplicates from the Name column but only if the corresponding value in Vehicle column is null. I know I can use df.dropduplicates(subset=['Name']) with either Keep = either 'First' or 'Last' but what I am looking for is a way to drop duplicates from Name column where the corresponding value of Vehicle column is null . So basically, keep the Name if the Vehicle column is NOT null and drop the rest. If a