1. Learn
  2. /
  3. Courses
  4. /
  5. ETL and ELT in Python

Connected

Exercise

Transforming JSON data

Chances are, when reading data from JSON format into a dictionary, you'll probably have to apply some level of manual transformation to the data before it can be stored in a DataFrame. This is common when working with nested dictionaries, which you'll have the opportunity to explore in this exercise.

The "nested_school_scores.json" file has been read into a dictionary available in the raw_testing_scores variable, which takes the following form:

{
    "01M539": {
        "street_address": "111 Columbia Street",
        "city": "Manhattan",
        "scores": {
              "math": 657,
              "reading": 601,
              "writing": 601
        }
  }, ...
}

Instructions

100 XP
  • Loop through both the keys and values of the raw_testing_scores dictionary.
  • Extract the "street_address" from each dictionary nested in the raw_testing_scores object.