I created a JSON file using pandas and not able to open the file as a dictionary, just as a string. Using windows, anaconda, python, pandas, and Jupyter notebooks.
I have checked StackOverflow for the issues and not able to find a useful solution. I did confirm with a simple json file the print(type(json.load(file)) does in fact produce a "class 'dict'"
'''
books = books[["AuthorName", "BookNumber", "BookTitle" ]]
books.head(10)
books_json = books.to_json(orient='index')
with open(path + 'books\\books_json.json', 'w'
) as out_put:
json.dump(books_json, out_put)
with open(path + 'books\\books_json.json', 'r'
) as out_put:
print(json.load(out_put))
print(type(json.load(out_put)))
error is:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
'''
I expect to see "class 'dict'" as the type when the "print(type(json.load(out_put)))" command is run, currently receiving an error.
Error is "JSONDecodeError: Expecting value: line 1 column 1 (char 0)"