[Numpy-discussion] Indexing a matrix with a scalar and ticket #707

Charles R Harris charlesr.harris at gmail.com
Mon Apr 28 21:03:07 EDT 2008


Yes, indeed.

Ticket #707: numpy.array fails if the input is a list of matrixes (with more
then one column).

The subroutine discover_dimensions in arrayobject.c indexes a matrix with a
scalar. It is a recursive routine and expects to find the next lower
dimension as it recurses down into the matrix. This works fine with matrices
with one column because the matrix row also has first dimension 1. Things
don't do so well if the matrices have more than one column. I expect this is
just the tip of a big pile of, um, stuff. The easy fix is to make indexing
by scalars the same for matrices and arrays. So I think the best thing to do
is provide that and figure out how to get the subarrays some other way.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080428/0dab29b0/attachment.html>


More information about the NumPy-Discussion mailing list