I have a dataframe that has a unique ID per person, their name, street, email and date. The dataframe may contain blanks and different characters like in this example:
ID Name Street Email Date
1 Paulo street #1 p@aa.com 2001-01-20
1 Paulo street #1 p@aa.com 20-Jan
1 Paulo street #1 p@aa.com 2001-01-20
2 Maria street #2 m@aa.com 2020-01-01
2 Mari street #2 m@aa.com 2020-01-01
3 Peter xx
4 Josh street #4 j@aa.com
4 Josh street #4 j@aa.com
I need a way to filter this dataframe by finding the IDs that repeats in column "ID" and return all rows that have any different value in any other of the columns. If this case happens, return all rows with the same ID, resulting in this dataframe:
ID Name Street Email Date
1 Paulo street #1 p@aa.com 2001-01-20
1 Paulo street #1 p@aa.com 20-Jan
1 Paulo street #1 p@aa.com 2001-01-20
2 Maria street #2 m@aa.com 2020-01-01
2 Mari street #2 m@aa.com 2020-01-01
What would be the best solution for it? Thank you for your help!