IniziaInizia gratis

Reading JSON data into memory

When data is stored in JSON format, it's not always easy to load into a DataFrame. This is the case for the "nested_testing_scores.json" file. Here, the data will have to be manually manipulated before it can be stored in a DataFrame.

To help get you started, pandas has been loaded into the workspace as pd.

Questo esercizio fa parte del corso

ETL and ELT in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

def extract(file_path):
  	# Read the JSON file into a DataFrame, orient by index
	return pd.____(file_path, orient="index")

# Call the extract function, pass in the desired file_path
raw_testing_scores = ____("____")
print(raw_testing_scores.head())
Modifica ed esegui il codice