[Numpy-discussion] Problem with concatenate and object arrays

A. M. Archibald peridot.faceted at gmail.com
Thu Sep 7 19:49:08 EDT 2006


Maybe I should stay out of this, but it seems like constructing object
arrays is complicated and involves a certain amount of guesswork on
the part of Numeric.

For example, if you do array([a,b,c]).shape(), the answer is normally
(3,) unless a b and c happen to all be lists of the same length, at
which point your array could have a much more complicated shape... but
as the person who wrote "array([a,b,c])" it's tempting to assume that
the result has shape (3,), only to discover subtle bugs much later.

If we were writing an array-creation function from scratch, would
there be any reason to include object-array creation in the same
function as uniform array creation? It seems like a bad idea to me.

If not, the problem is just compatibility with Numeric. Why not simply
write a wrapper function in python that does Numeric-style guesswork,
and put it in the compatibility modules? How much code will actually
break?

A. M. Archibald




More information about the NumPy-Discussion mailing list