Fastest way to parse JSON strings into numpy arrays
<p>I have huge json objects containing 2D lists of coordinates that I need to transform into numpy arrays for processing. </p>

<p>However using <code>json.loads</code> followed with <code>np.array()</code> is too slow. </p>

<p>Is there a way to increase the speed of creation of numpy arrays from json?</p>

<pre><code>import json
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]]]}'

dict = json.loads(json_input)
numpy_2d_arrays = [np.array(ring) for ring in dict["rings"]]
</code></pre>

<p>I would take any solution whatsoever!</p>