How to access the ith column of a NumPy multidimensional array?
0]array([1, 3, 5])test[:,
this command gives you a row vector, if you just want to loop over it, it's fine, but if you want to hstack with some other array with dimension 3xN, you will have
ValueError: all the input arrays must have same number of dimensions
0]]array([, , ])test[:,[
gives you a column vector, so that you can do concatenate or hstack operation.
0]]))array([[1, 2, 1], [3, 4, 3], [5, 6, 5]])np.hstack((test, test[:,[