[SciPy-user] shape

linda.s samrobertsmith@gmail....
Thu Apr 26 13:38:11 CDT 2007


I am curious about the (9,) for the shape. Does it mean 9 rows one
column or one row 9 columns? The final array looks like one row 9
columns but why (9,) gives me an impression that it is 9 rows one
column? Thanks.

>>> from numpy import *
>>> numarr2
array([[ 2,  4,  6],
       [ 8, 10, 12],
       [14, 16, 18]])
>>> numarr2.shape = (9,)
>>> print numarr2
[ 2  4  6  8  0 12 14 16 18]


More information about the SciPy-user mailing list