I wrote a code to load json contents. How should I modify this to save it as a dictionary or even save it as a data frame?
import json import traceback import pandas as pd def read_json_file(fname): with open(fname, "r") as f: try: return json.load(f) except Exception as e: print ("Error parsing %s" %fname) traceback.print_exc() raise e print(read_json_file("/Desktop/file1.txt"))