drop duplicates pandas not working with float values code example Example: drop duplicate rows pandas except nan df[(~df.duplicated()) | (df['col'].isnull())]