Fastest conversion of 3d list to numpy array (cython?)

Viewed 139

I have a problem since I found out that converting a large list to an array is very slow I looked for faster ways. I stumpled over cython. The only thing I found for conversion is the standard wy with np.array(a,dtype=np.float32)

I would like to cast a 3d list like the following into an array with cython?

a = [[[1,2,3,8],[4,1,2,4],[1,2,3,8],[4,1,2,4], [4,1,2,4]],[[3,5,3,8],[4,3,2,5],[1,2,3,8],[4,1,2,4], [4,1,2,4]]]

How could I do that?

Thank you.

0 Answers
Related