Transforming and Flattening Data
February 23, 2020•770 words
Transforming and flattening lists
A while back I had a the need to take what were essentially audit logs, where multiple records existed for each id, and flatten then into a single record for each id.
I pulled the data into python from a database as a list of over 100,000 tuples. Here is an example of the data I was looking at.
RECORD,ID,OLD_VALUE,NEW_VALUE,DATE,TABLE,COLUMN
1, id1, value1, value2, 02/01/2020, table1, column1
2, id1, value2, value3, 02/02/2020, table1, column1
3, id1, valu...
Read post