Arshad Mehmood

Search the blog

    Today I Learned

    Read json file to pandas Dataframe

    python

    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.