Read JSON into Pandas Dataframe

  • 1
  • Question
  • Updated 7 months ago
I am looking for guidance on transforming the Wunderground API JSON responses into a Python Pandas DataFrame. There is no prior conversation in this forum. The JSON responses (multiple records appended to a single dataset) are correctly structured based on my read/write tests. Unfortunately, I am stumbling with the basic Pandas read command:

import pandas as pd
wu = pd.read_json("Chicago.json")

The error message is: ValueError: DataFrame constructor not properly called!

What additional parameters need to be passed in the read_json method? There is a long list of parameters but naturally, as a newbie, I am having challenges at the starting block. How should the Wunderground API responses be cast into a Pandas DataFrame using some of additional parameters for the read_json method? Thanks.
Photo of Matha Goram

Matha Goram

  • 1 Post
  • 0 Reply Likes

Posted 7 months ago

  • 1

Be the first to post a reply!