skip to Main Content

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

Python Pandas extract csv column containing json

I want to learn Pandas framework, so I find free csv with Euro data from kaggle.com https://www.kaggle.com/datasets/piterfm/football-soccer-uefa-euro-1960-2024/data But there're plenty of columns which looks like this subset['goals'][1] "[{'phase': 'FIRST_HALF', 'time': {'minute': 7, 'second': 41}, 'international_name': 'Xavi Simons', 'club_shirt_name': 'Xavi', 'country_code':…

VIEW QUESTION

Json – CSV data format to nested dictionary

I have below csv format. I want it to convert some nested dict. name,columns,tests ABC_ESTIMATE_REFINED,cntquota,dbt_expectations.expect_column_to_exist ABC_ESTIMATE_REFINED,cntquota,not_null ABC_ESTIMATE_REFINED,is_purged,dbt_expectations.expect_column_to_exist ABC_ESTIMATE_REFINED,is_purged,not_null Expected Output { "name": "ABC_ESTIMATE_REFINED", "columns": [ { "name": "cntquota", "tests": [ "dbt_expectations.expect_column_to_exist", "not_null" ] }, { "name": "is_purged", "tests": [ "dbt_expectations.expect_column_to_exist",…

VIEW QUESTION
Back To Top
Search