With this sample pandas df:
ColA ColB ColC
Apple Fruit Food
Apple Fruit Pie
Apple Arrow Story
I am attempting to roll through the dataframe and if the values in ColA and ColB are the same in the current row as in the previous row, delete the current rows values for those two columns only.
The expected result would be:
ColA ColB ColC
Apple Fruit Food
Pie
Apple Arrow Story
I attempted various loops with iloc grabbing the current rows values for those two columns, storing them in a variable and then checking if the subsequent row is identical. However, on my 5 row test data, kept getting error that the list index was out of range. Stumped at this point.