Code example:
import numpy as np
arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]])
newarr = arr.reshape(arr.shape[0], 1, arr.shape[1])
If you have any further question, please write it down on the comments below...
#python #programmingpython #reshapearray #arraypython #solvingbugs
On this page of the site you can watch the video online Reshape 2D to 3D array in Python with a duration of hours minute second in good quality, which was uploaded by the user SolvingBugs 07 May 2022, share the link with friends and acquaintances, this video has already been watched 1,110 times on youtube and it was liked by 19 viewers. Enjoy your viewing!