[Python] Trying to flatten the below json unable to do it please need help to flatten nested...

Discussão em 'Python' iniciado por Stack, Julho 4, 2025.

  1. Stack

    Stack Membro Participativo

    data =''' [ { "ANA_TY": "ay_type", "ANA_SUB_TY": "sub_type", "DAG_ID": "dagid1234", "PARAMETERS": { "char": [], "cp": "cp", "area": [ "kar" ], "YEAR": [ 2025 ], "id": "12345", "where": "N/A", "where_sbu": "N/A", "where_sub_sbb": [ "BAN" ], "pipe name": [ "total pipe" ], "create_ts": 1743602396.455894, "modified_ts": 1743602396.455894, "create_user": "user1", "modified_user": "user1" }, "output": { "filetype": { "datatype": "yes" } }, "businessname": [ "businessname" ], "genid": "1234uuid", "dep_run": [ { "rid": "rundid123", "wid": "workid123", "wowv": 1, "wt": "wtpe1", "wst": "wst1", "bk": [ "bk_input", "bk_out" ], "outpath": "c:/download/file.txt" } ] } ] '''

    df_json=pd.json_normalize(data) print(df_json)

    Continue reading...

Compartilhe esta Página