Answers for "convert 3 dimensional numpy array to two dimensional array"

1

python convert multidimensional array to one dimensional

In [12]: a = np.array([[1,2,3], [4,5,6]])

In [13]: b = a.ravel()

In [14]: b
Out[14]: array([1, 2, 3, 4, 5, 6])
Posted by: Guest on March-04-2021
-1

how to convert one dimensional array into two dimensional array

x = x.reshape(-1, 1)

# remember to check shape of your variable using x.shape, if it shows
# (y, n) then it is already 2D, if it shows (y,) instead, it is 1D.
Posted by: Guest on July-08-2020

Code answers related to "convert 3 dimensional numpy array to two dimensional array"

Python Answers by Framework

Browse Popular Code Answers by Language