I have a json file and I'm trying to read the file using the below code
import json
with open('sample.json') as file:
data = json.load(file)
and I'm getting the below error
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
My guess was the json file was not valid so I opened the json file in a text editor and copied the data and tried to validate it via online json validator and the online tool confirmed that its a valid json.
So i wanted to understand what my notebook is reading when I read the file so I tried to print the string and surprisingly the string had a lot of unwanted values such as \n and  etc which is definately not there when I open the json file in the notepad.
with open('sample.json') as file:
test_text = file.read()
print(test_text)
o/p I get in python notebook when I try to print the read file:
'[{"iteration" : {"id" :"value"},
"filename" : "testfile.json"
}\n,
{"iteration" : {"id" :"value1"},
"filename" : "testfile2.json"
}\n]'
Please advise what I'm doing wrong and how to fix this