[Numpy-discussion] untenable matrix behavior in SVN

Gael Varoquaux gael.varoquaux@normalesup....
Sat Apr 26 13:32:40 CDT 2008


On Sat, Apr 26, 2008 at 02:32:01PM -0400, Alan G Isaac wrote:
> A list of lists is naturally conceived as 2d,
> which is why you can initialize a 2d matrix
> with a list of lists.

> Try a Google search on "python two dimensional list"
> to confirm that I am not promoting an anomalous view.

> So I do not buy the way you are trying to parse
> language here.  (Although I'm open to a fuller
> argument.)

The object is not 2D. You can assemble several objects into something
that looks 2D, but it is not 2D.

For exemple:

[[1, 2, 3], [1, 2]]

This is not 2D in an nd array sens. It how exposes a double successiv
indexing, but doubly 1D, and no 2D.

For nD objects, I think people should rather use either nD indexing, or
explicite 1D indexing of an nD object. By this is mean "A[1, ...]" rather
than "A[1]". If the later breaks, I, for one, won't cry.

Gaël


More information about the Numpy-discussion mailing list