0

I used to have a simple row and column format in table and was reading it by pandassql .

but if you have structure like below and want to get age>10 from this , how do I get it using pandassql?

  [  {
    "response":{
      "version":"1.1",
      "token":"dsfgf",
       "body":{
         "customer":{
             "customer_id":"1234567",
             "verified":"true"
           },
         "contact":{
             "email":"mr@abc.com",
             "mobile_number":"0123456789"
          },
         "personal":{
             "gender": "m",
             "title":"Dr.",
             "last_name":"Muster",
             "first_name":"Max",
             "family_status":"single",
             "dob":"1985-12-23",
         }
       }
     } ]
Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
user15780176
  • 109
  • 8
  • there is an error with the json. need to remove the first bracket. – D.L May 27 '21 at 22:42
  • Does this answer your question? [Pandas read nested json](https://stackoverflow.com/questions/40588852/pandas-read-nested-json) – D.L May 27 '21 at 23:00

1 Answers1

0

This is answered here:

Pandas read nested json

You can use json_normalize

There is also a full description of the dame issue here:

https://medium.com/swlh/converting-nested-json-structures-to-pandas-dataframes-e8106c59976e

D.L
  • 4,339
  • 5
  • 22
  • 45