I have huge json objects containing 2D lists of coordinates that I need to transform into numpy arrays for processing.
However using json.loads followed wi
json.loads
For this specific data, you could try this
import numpy as np json_input = '{"rings" : [[(-8081441.0, 5685214.0), (-8081446.0, 5685216.0), (-8081442.0, 5685219.0), (-8081440.0, 5685211.0), (-8081441.0, 5685214.0)]]}' i = json_input.find('[') L = eval(json_input[i+1:-2]) print(np.array(L))