Consider the following code:
array = np.array2string(np.arange(27).reshape(3,3,3))
This creates a numpy array with 3D dimension. The output will look like this:
[[[ 0 1 2]
[ 3 4 5]
[ 6 7 8]]
[[ 9 10 11]
[12 13 14]
[15 16 17]]
[[18 19 20]
[21 22 23]
[24 25 26]]]
I want to convert this numpy array to a python list where each index corresponds to a line in the numpy array. It is important to note that there is a whitespace between each number. So the output would look like this:
Index Type Size Value
0 str 5 0 1 2
1 str 5 3 4 5
2 str 5 6 7 8
3 str 5 9 10 11
....
.... and so on
How would I code this?