I'm relatively new to python and completely new to json files, I'm trying to follow the simple example below:
import json
# Load the data into a list
filename = 'population_data.json'
with open(filename) as f:
pop_data = json.load(f)
When I try to download the data found here:
https://github.com/ehmatthes/pcc/blob/master/chapter_16/population_data.json
I get the following error:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I'm using pycharm in windows 10. Could it be related to the way that I am downloading the json file from GitHub? I download it as a txt file then resave it as a Json file it appears to be correct but clearly the code is not working. If this is not correct, what is the correct way to download a json file from Githib?
Thanks
Baz