[Numpy-discussion] Improved creation of object arrays

Travis Oliphant oliphant.travis at ieee.org
Wed Jul 19 12:08:52 EDT 2006


Travis Oliphant wrote:
> I made a small change to the array creation function so that if you 
> explicitly specify dtype=object, then the logic for determining the 
> shape of the array is changed.
>
> The new logic for constructing dtype=object arrays from Python sequences 
> is that the shape is determined by nested lists (and only lists).  The 
> nesting must be consistent or else the elements of the last conforming 
> lists are assumed to be objects.
>   

Update:  

Now lists and tuples are both allowed for determining nested lists (that 
was needed for record arrays).

The shapes still have to match for a new dimension to be "detected"

-Travis





More information about the NumPy-Discussion mailing list