0

When I convert my current python parquet file to JSON, it gives me the key paths instead of exploding them out. How do I turn the keys into nested JSON?

I am currently getting:

[
{
  "version":1,
  "school.texas.austin.department.mathematics.classroom":321,
  "school.texas.austin.department.mathematics.admin_num":12345,
  "school.texas.dallas.department.marketing.classroom":88145,
  "school.texas.dallas.department.marketing.professor_lastName":"Gobble",
  "school.texas.dallas.department.marketing.policy_id":193213781
}
]

Instead, I want:

[
{
  "version":1,
  "school":{
    "texas":{
      "austin":{
        "department":{
          "mathematics":{
            "classroom":321,
            "admin_num":12345
          }
        }
      },
      "Dallas":{
        "department":{
          "marketing":{
            "classroom":88145,
            "professor_lastName":"Gobble",
            "policy_id":193213781
          }
        }
      }
    }
  }
}
]
bnykpp
  • 25
  • 3
  • maybe this [link](https://coderedirect.com/questions/403621/convert-dot-notation-string-into-nested-python-object-with-dictionaries-and-arra) is helpful – JJ. Dec 29 '21 at 20:52

0 Answers0