I have an array that is 1d, and I would like to print it as a column.
r1 = np.array([54,14,-11,2])
print r1
gives me this:
[ 54 14 -11 2]
and
print r1.shape
gives me this:
(4L,)
Is there something I can plug into np.reshape() so that
print r1.shape
gives me this?
(,4L)
And the printed output looks something like
54
14
-11
2
shapeis a tuple.(4,)is standard Python syntax for a 1 element tuple.(,4)is not valid syntax. Neither is an abbreviation for 2d shapes like (1,4) or (4,1). (4,1) is the shape of an array with 4 'rows' and 1 'column', which will display as you want.