I'm comparing two tables to monitor for changes. I need a resulting table that shows a before and after the change per user per attribute changed.
I used the pandas .compare method and below is an example of my current result, but I can't figure out what the next steps would be. If I'm going about this completely wrong feel free to let me know as well.
I currently have a table that looks like this:
User ID | Name | Favorite | Status |
---|---|---|---|
1 | Steve | Chocolate | Before |
2 | John | Chocolate | Before |
1 | Stevy | Chocolate | After |
2 | John | Vanilla | After |
I need it to look like this:
User ID | Attribute Changed | Before | After |
---|---|---|---|
1 | Name | Steve | Stevy |
2 | Name | John | John |
1 | Favorite | Chocolate | Chocolate |
2 | Favorite | Chocolate | Vanilla |
I can eliminate the lines where no changes were made.