I have a table having duplicate rows in consecutive rows. Row having same 'id' should have duplicate data in other columns.But there are few rows in which data is not proper. Eg -
id Name Age
1 Ram 12
1 Ram 10
2 Shyam 11
2 Yam 11
3 Ravi 23
3 Ravi 23
4 Harsh 34
4 Harsh 34
I need to know the columns in which the columns differ for consecutive rows.
Final output I need -
id Name Age DifferentColumn
1 Ram 12
1 Ram 10 Age
2 Shyam 11
2 Yam 11 Name
3 Ravi 23
3 Ravi 23
4 Harsh 34
4 Krish 54 Name,Age
I can use 'petl' or 'pandas' for this but what should be my approach?