This seems quite difficult for me. I have tried multiple solution but it didn't worked
my original array is in this form:
arr = np.array([
[
[1, 3, 9, 1],
[2, 2, 9, 1],
[1, 1, 6, 4],
],
[
[3, 3, 3, 4],
[0, 9, 2, 6],
[7, 6, 6, 1],
]
])
Where as my expected output is:
arr = np.array(
[
[
[
[1],
[2],
[1],
],
[
[3],
[2],
[1],
],
[
[9],
[9],
[6],
],
[
[1],
[1],
[4],
],
],
[
[
[3],
[0],
[7],
],
[
[3],
[9],
[6],
],
[
[3],
[2],
[6],
],
[
[4],
[6],
[1],
],
],
]
)
How can I achieve above output, i have tried np.reshape(arr, (len(arr[0][0]), len(arr[0]), 1))
and many more but failed to obtain my expected output. Please suggest changes.