df = pd.json_normalize(data)ĭespite the additional command my DataFrame displayed the same result. I decided to reference the pandas documentation and apply the built-in solution pandas.json_normalize. Luckily JSON files are inherently nested by nature and there are plenty of approaches to this problem. Upon closer inspection, I noticed the last column stored the missing keys as a list instead of separate columns - and the rummaging began. My DataFrame was not displaying all the columns represented by the JSON file. Unfortunately that was not the case and my DataFrame showcased 11,522 rows by 13 columns. This meant the data I was loading would drop to 21 columns. I also decided to take it one step further and directly populate my DataFrame through the first nested level using “_items”. Within my application however I decided to omit the meta data. “WhPerMile”,”kWhRequested”, “milesRequested”,”minutesAvailable”,”modifiedAt”,”paymentRequired”,”requestedDeparture”,”userID”Ĭonsidering these keys would eventually assume columns in a DataFrame, without any manipulation this file should accrue a total of 23 columns.“_id”, “clusterID”, “connectionTime”,“disconnectTime”, “doneChargingTime”,“kWhDelivered”, “sessionID”, “siteID”, “spaceID”, “stationID”, “timezone”, “userID”, “userInputs”.The acndata_sessions file had three nested levels: Had I looked it over, I would have acknowledged that my JSON file was nested and required a bit of manipulation. At the time, I had very minimal experience with JSON files and neglected to inspect it before adopting it to my workspace. The JSON file I used for my project embodied both these rules and persisted for a total of 11,522 sessions.