i have a huge dataset as array in the format below
#input array
array([ 5.94911 , -1.0366 , 3.25678 ])
i need to convert it to arrays in the format below.
array([[5.94911],
[-1.0366],
[ 3.25678]])
Try using np.vstack:
>>> a = array([ 5.94911 , -1.0366 , 3.25678 ])
>>> np.vstack(a)
array([[ 5.94911],
[-1.0366 ],
[ 3.25678]])
>>>
Or use a list comprehension:
>>> a = array([ 5.94911 , -1.0366 , 3.25678 ])
>>> np.array([[i] for i in a])
array([[ 5.94911],
[-1.0366 ],
[ 3.25678]])
>>>
But of course vstack is recommended.