I have a .csv
which I've generated a dataframe from. This csv has raw data outputs from a system that follows this format:
{"DataType1":"Value","DataType2":"Value","DataType3":"Value",.....}
Each row in the dataframe has just this in 1 column. I'm trying to break this out so that the data types become column headers and the values populate the rows. One other aspect is that not all rows have the same data types, some have additional data types that might not be present in other rows. For example row 1 may have DataType1
, DataType2
, and DataType3
and row 2 may have DataType2
, DataType4
, and DataType5
. Ideally I'd like for the output to have the column headers incorporate all data types whether that row has a value for it or not. So the final dataframe would this structure:
-------------------------------------------------------------
| DataType1 | DataType2 | DataType3 | DataType4 | DataType5 |
-------------------------------------------------------------
| Value | Value | Value | NaN | NaN |
-------------------------------------------------------------
| NaN | Value | NaN | Value | Value |
-------------------------------------------------------------