I am trying to join json files:
path_to_json = 'generated_playlists/p1/'
json_files = [pos_json for pos_json in os.listdir(path_to_json) if pos_json.endswith('.json')]
json files are structured like this:
{"user1": {"Wild Wood": 1.0, "You Do Something To Me": 1.0, "Reprise": 1.0}}
but when I do:
for js in json_files:
with open(os.path.join(path_to_json, js)) as json_file:
pd_data = json.load(json_file)
I get:
ValueError: Extra data: line 1 column 145 - line 1 column 721 (char 144 - 720)
what is wrong with json.load()?
json.loadtryandexceptso only bad files don't get loaded.