0

I am trying to read a folder that has multiple .json files in them. I want to convert each file into numpy array. This is my code

labelarray = []
for filename in glob.glob(r'C:/Users/samin/Desktop/Wolution/Datastets/Grass/label/*.json'):

    json_img = json.load(filename)
    numpy_2d_arrays = np.array(json_img)
    labelarray.append(im2arr)

but I get an error:

File "<unknown>", line 1
    C:/Users/samin/Desktop/Wolution/Datastets/Grass/label\Fuji V1 B1 24.05.json
     ^
SyntaxError: invalid syntax

I have no idea what causes this error. Any hints will be appreciated.

parastoo91
  • 151
  • 1
  • 12

0 Answers0