You can numpy.reshape it to (-1,1) to get the result in the form you want. Example -
narray = narray.reshape((-1,1))
Demo -
In [19]: import numpy as np
In [20]: narray = np.arange(10)
In [21]: narray
Out[21]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
In [22]: narray.reshape((-1,1))
Out[22]:
array([[0],
[1],
[2],
[3],
[4],
[5],
[6],
[7],
[8],
[9]])
Basically what you are doing is to change the shape of the array from something like - (n,) to (n,1) , you do this by using reshape() , in it you can pass -1 as one of the arguments. As given in documentation -
newshape : int or tuple of ints
The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.