using linspace() and reshape() functions. We can use the following Python code to do the same:
import numpy array3 = numpy.linspace(1, 12, 12, endpoint=True).reshape(2, 3, 2) print(array3) print(array3.shape)
The output of the above program will be like the following:
[[[ 1. 2.] [ 3. 4.] [ 5. 6.]] [[ 7. 8.] [ 9. 10.] [11. 12.]]] (2, 3, 2)
So, array3 is a three-dimensional array that has 2, 3, and 2 elements across the three dimensions, respectively.








































0 Comments