[Numpy-discussion] Array shape

Ryan May rmay31@gmail....
Fri Oct 3 11:44:23 CDT 2008

Kelly Vincent wrote:
> I'm using Numpy to do some basic array manipulation, and I'm getting
> some unexpected behavior from shape. Specifically, I have some 3x3 and
> 2x2 matrices, and shape gives me (5, 3) and (3, 2) for their respective
> sizes. I was expecting (3, 3) and (2, 2), for number of rows, number of
> columns. I'm assuming I must either be misunderstanding what shape gives
> you or doing something wrong. Can anybody give me any advice? I'm using
> Python 2.5 and Numpy 1.1.0.

Can you post a complete, minimal example that shows the problem you
have?  For an array object A, A.shape should give the shape you're


Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

More information about the Numpy-discussion mailing list