1. Learn
  2. /
  3. Courses
  4. /
  5. Streamlined Data Ingestion with pandas

Exercise

Work with JSON orientations

JSON isn't a tabular format, so pandas makes assumptions about its orientation when loading data. Most JSON data you encounter will be in orientations that pandas can automatically transform into a dataframe.

Sometimes, like in this modified version of the Department of Homeless Services Daily Report, data is oriented differently. To reduce the file size, it has been split formatted. You'll see what happens when you try to load it normally versus with the orient keyword argument. The try/except block will alert you if there are errors loading the data.

pandas has been loaded as pd.

Instructions 1/2

undefined XP
  • 1

    Try loading dhs_report_reformatted.json without any keyword arguments.

  • 2

    Load dhs_report_reformatted.json to a dataframe with orient specified.