Skip to content

Concatenate with sequence that contains empty sequences. (Trac #988) #1586

@thouis

Description

@thouis

Original ticket http://projects.scipy.org/numpy/ticket/988 on 2009-01-22 by trac user kelson, assigned to unknown.

Howdy,

After searching for this defect, perhaps nobody else has been bothered
by this behaviour, but has anybody else noticed:

concatenate ( [[1],[2],[3],[4]] ).dtype = int32

concatenate ( [[1],[2],[3],[]] ).dtype = int32

concatenate ( [[],[2],[3],[4]] ).dtype = float64

I have a lot of old-style Numeric stuff that likes to concatenate lists
of indices which then were used with take [which does not like floats]. So
below [in theory] I attach my attempt at a patch so that empty items in the sequence are
not used to influence the common type that is used by PyArray_ConvertToCommonType.

Maybe it is of some value, or maybe I didn't do this in a kosher manner and
someone else has an idea of where things should be rethought for this defect?

Cheerio.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions