I am trying to use the spread function in dplyr to "flatten" a table but it does not appear to be working as intended.
I am trying to flatten this one so that each Record Number is appearing on one line only, so end result would be as follows:
This seems like it should be a no-brainer with spread with code as follows:
spread(dt, key = 'Record Type', value = 'Status')
but what I am ending up with is still multiple lines per Record Number:
Not understanding why this is not properly flattening out by the Record Number? Any clues? Also, any more recommended method to flatten data tables in Python (Pandas)?