I have an dataset which contains JSON dictionary as a column. I want to parse this column to the new columns based on their keys. The column itself is an object and df.iloc gives me a string, so I couldn't figure out how to handle it. I tried json_normalize and tolist but apparently they were wrong.
Unnamed: 0 _id userInputs sessionID
222 222 5bc915caf9af8b0dad3c0660 [{'userID': 22, 'milesRequested': 170, 'WhPerM... 2_39_88_24_2018-04-30 15:07:48.608581
and userInputs:
c.iloc[0]['userInputs']
"[{'userID': 22, 'milesRequested': 170, 'WhPerMile': 350, 'minutesAvailable': 550, 'modifiedAt': 'Mon, 30 Apr 2018 15:08:54 GMT', 'paymentRequired': True, 'requestedDeparture': 'Tue, 01 May 2018 00:17:49 GMT', 'kWhRequested': 59.5}]"
So userID, milesRequested etc. will be added as a new column corresponding to their values for all dataset.