I want to convert python 2d list,
[[1,2,3],[4,5,6]]
to
python3 array.array type,
[ [1 2 3]
[4 5 6] ]
The most important challenge is I wont import numpy.
So I cant use np.asarray().
I have also used array.fromlist() and array.extend().
Both methods are creating an array of single dimension.
But I want to convert multi dimension list to multi dimension array.
Is there any way?
numpy.ndarrayhas attributes likeshapeandstrideswhich allow it to represent multidemensional arrays. Pythonarraydoes not have those. It also does not implement anobject(or pointer) type, which would allow it to 'contain' lists or other objects.