less than 1 minute read

Read json file to pandas Dataframe

Reading a json file is very easy.

file_activeingredient = open('opencanada/activeingredient.json', 'r')

# Load the first sheet of the JSON file into a data frame
activeingredients = pd.read_json(file_activeingredient, orient='records')

# View the first ten rows
# print(activeingredients.head(10))

More info here and here.

Leave a comment