I have a dataframe where one column is the account code and the secondary column is the description, and need to flag up instances where an account code has more than one description present. For example to take this:
Acc. Code Description
0 0001 Description 1
1 0002 Description 2
2 0002 Description 2
3 0003 Description 3
4 0003 Desc. 3
5 0004 Description 4
6 0005 Description 5
7 0006 Description 6
8 0006 Desc. 6
9 0006 desc. Six
10 0007 Description 1
and adjust it so I have a dataframe like this, which will later be used to choose which description to prioritise and map for all instances of that code:
Acc. Code Description
0 0003 Description 3
1 0003 Desc. 3
2 0006 Description 6
3 0006 Desc. 6
4 0006 desc. Six
I haven't been able to find anything specific to pandas to filter for duplicates based on multiple column values.