I have a problem with a numpy array.
In particular, suppose to have a matrix
x = np.array([[1., 2., 3.], [4., 5., 6.]])
with shape (2,3)
, I want to convert the float numbers into list so to obtain the array [[[1.], [2.], [3.]], [[4.], [5.], [6.]]]
with shape (2,3,1)
.
I tried to convert each float number to a list (i.e., x[0][0] = [x[0][0]]
) but it does not work.
Can anyone help me? Thanks