xxxxxxxxxx
arr_of_lists =
arr_2d = np.array(list(arr_of_lists))
xxxxxxxxxx
arr2d = [[arr1d[i+j*width] for i in range(width)] for j in range(height)]
xxxxxxxxxx
>>> tp = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> tp.ndim
1
>>> tp.shape
(10,)
>>> fp = np.array([10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
>>> fp.ndim
1
>>> fp.shape
(10,)
>>> combined = np.vstack((tp, fp)).T
>>> combined
array([[ 0, 10],
[ 1, 11],
[ 2, 12],
[ 3, 13],
[ 4, 14],
[ 5, 15],
[ 6, 16],
[ 7, 17],
[ 8, 18],
[ 9, 19]])
>>> combined.ndim
2
>>> combined.shape
(10, 2)