title: Traversing through a tree-like json
body: <p>I am new to python and trying to traverse through a tree-like json and print it in key, value pairs.
  I am being able to iterate through the first level of key-value pairs but i am stuck at "data" which is a list of dictionaries and I want to iterate through each element in key-value pairs </p>
  
  <pre><code>import json
  import pandas as pd
  import numpy as np
  abc = {
      "train_data_size": 537,
      "validate_data_size": 77,
      "test_data_size": 154,
      "total_data_size": 768,
      "no_of_columns": 9,
      "data": [{
              "Pregnancies": 6,
              "Glucose": 148,
              "BloodPressure": 72,
              "SkinThickness": 35,
              "Insulin": 0,
              "BMI": 33.6,
              "DiabetesPedigreeFunction": 0.627,
              "Age": 50,
              "Age_Dummy": 50,
              "Outcome": 1
          },
          {
              "Pregnancies": 1,
              "Glucose": 85,
              "BloodPressure": 66,
              "SkinThickness": 29,
              "Insulin": 0,
              "BMI": 26.6,
              "DiabetesPedigreeFunction": 0.35100000000000003,
              "Age": 31,
              "Age_Dummy": 31,
              "Outcome": 0
          },
          {
              "Pregnancies": 8,
              "Glucose": 183,
              "BloodPressure": 64,
              "SkinThickness": 0,
              "Insulin": 0,
              "BMI": 23.3,
              "DiabetesPedigreeFunction": 0.672,
              "Age": 32,
              "Age_Dummy": 32,
              "Outcome": 1
          },
          {
              "Pregnancies": 1,
              "Glucose": 89,
              "BloodPressure": 66,
              "SkinThickness": 23,
              "Insulin": 94,
              "BMI": 28.1,
              "DiabetesPedigreeFunction": 0.16699999999999998,
              "Age": 21,
              "Age_Dummy": 21,
              "Outcome": 0
          },
          {
              "Pregnancies": 0,
              "Glucose": 137,
              "BloodPressure": 40,
              "SkinThickness": 35,
              "Insulin": 168,
              "BMI": 43.1,
              "DiabetesPedigreeFunction": 2.2880000000000003,
              "Age": 33,
              "Age_Dummy": 33,
              "Outcome": 1
          }
      ]
  }
  
  # for k in abc.items():
  #     for i, v in enumerate(k):
  #         print("Key: " + str(k))
  #         print("Value: " + str(v), "key: " + str(i))
  data = json.load(abc)
  new_dict = {}
  my_list = []
  for (k, v) in data.items():
      print("Key: " + k)
      print("Value: " + str(v))
      my_list = [{'data':x} for x in range(1,10)]
      for ke, va in enumerate(my_list):
          print("key: " + str(ke))
          print("value: " + str(va))
      # for key, value in new_dict.items():
      #     new_dict[value] = key
      #     print("key: " + key)
      #     print("value " + str(value))
      #     if len(value)
          # for ke, va in enumerate(value):
          #     print("key: " + str(ke))
          #     print("value: " + str(va)) 
  </code></pre>
  
  <p>I want to  see this in "key":"value" at all levels. I am being able to iterate the first set as in the first level. I am not being able to iterate through the list of dictionaries in "data".</p>