9951 explained code solutions for 126 technologies


python-numpyLoad Numpy array data from JSON


import numpy as np
import json as json

jsn = '[[1,2],[3,4]]'
a = np.array(json.loads(jsn))ctrl + c
import numpy as np

load Numpy module for Python

import json as json

load JSON module to parse JSON

np.array

create Numpy array from given list

'[[1,2],[3,4]]'

sample JSON string to create Numpy array from

json.loads(

parse given JSON data to list