I have a pandas dataframe with multiple columns and rows. I wish to find the consecutive duplicate values in a particular column and delete the entire row of the first occurrence of that duplicate value.
I found a possible solution but it works only with pandas series.
a.loc[a.shift() != a]
This is the link to the mentioned solution
To visualize my dataframe would be something like this:
Index column0 column1 column2 column3
row0 0.5 25 26 27
row1 0.5 30 31 32
row2 1.0 35 36 37
row3 1.5 40 41 42
Index column0 column1 column2 column3
row1 0.5 30 31 32
row2 1.0 35 36 37
row3 1.5 40 41 42
This would be expected result with the row0 deleted.
P.S This duplicate occurrence does not happen at the beginning in my data, it occurs in random in the column0.