This is what I have:
someArray = [10]
print(np.tranpose(someArray))
and I'm getting:
[0 0 0 0 0 0 0 0 0 0 0]
But I want it vertically. What am I doing wrong?
This is what I have:
someArray = [10]
print(np.tranpose(someArray))
and I'm getting:
[0 0 0 0 0 0 0 0 0 0 0]
But I want it vertically. What am I doing wrong?
First, you have to convert your array to a numpy array, as long as this has not been done yet. Now you just have a 1D array. In Python, it is important to have a 2D array to perform some array/matrix operations. You just have to use an additional bracket pair [...]. Then you can simply use ".T" to transpose your array. Try this:
import numpy as np
someArray = [1,2,3,4,5,6,7,8]
someArray = np.array([someArray])
someArray_transposed = someArray.T
Try this:
import numpy as np
someArray = [0]*10
print(np.transpose(someArray).reshape((len(someArray),1)))