'Remove repeating column values in Python Pandas

I have a data set that has dates and subtotal of other columns. enter image description here

I want to remove the same recurring dates per subtotal

enter image description here



Solution 1:[1]

You can simply set the index of the current DataFrame using its existing columns with the help of DataFrame.set_index.

df.set_index(['w/c Mon', 'Portfolio'])

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 marc_s