skip to Main Content

read nested json inside csv file using pandas?

I have a csv file that with rows that looks like this: 745198;2024-09-10 10:09:10.7;leaf-2;{"Accelerometer": {"X": 0.055297852, "Y": 0.993530273, "Z": 0.000244141}} 745199;2024-09-10 10:09:10.71;leaf-2;{"Accelerometer": {"X": 0.056274414, "Y": 0.994384766, "Z": 0.000976563}} 745200;2024-09-10 10:09:10.721;leaf-2;{"Accelerometer": {"X": 0.055786133, "Y": 0.994018555, "Z": 0.000854492}} 745201;2024-09-10 10:09:10.732;leaf-2;{"Accelerometer": {"X": 0.055053711,…

VIEW QUESTION

Parsing text and JSON from a log file with three lines (request, response, record)

I have a .csv log file containing three json lines for each client. For example: {"name":"John","phone":"08847","politic":"on","ville":"LA","isTest":"false","source":"t3_1"} {"data":{"name":"John","phone":"+8847","city":"LA","source":"t3_1","cameF":"a1"},"token":"bd67a","isTest":false} {"data":{"responseId":"R_2hs","city":"LA","cameF":"cpl_agency2","source":"t3_1"},"success":true,"ts":1721394844,"message":null} I don't understand how you can combine three separate lines into one and then read the json. Starting reading the file: import…

VIEW QUESTION
Back To Top
Search