0

I have a DataFrame (df)

             mark
snap_time        
140000     8250.0
140000     8250.0
141000     8252.0
141000     8252.0
142000     8249.0

I'm trying to remove any rows with the same snap_time index

I've tried:

df.drop_duplicates(subset=None, keep=False, inplace=False)

But it's not removing the duplicate rows.

The desired output from this example would be:

             mark
snap_time        
140000     8250.0
141000     8252.0
142000     8249.0
ayhan
  • 70,170
  • 20
  • 182
  • 203
Stacey
  • 4,825
  • 17
  • 58
  • 99

1 Answers1

0

try explicitly telling which columns to check for matching duplicates

df.drop_duplicates(subset=['snap_time', 'mark'], keep=False)
Anurag Sharma
  • 2,409
  • 2
  • 16
  • 34