Skip to content

DISCUSS: Should object array comparisons return objects? (Trac #2117) #577

@numpy-gitbot

Description

@numpy-gitbot

Original ticket http://projects.scipy.org/numpy/ticket/2117 on 2012-04-26 by @yarikoptic, assigned to unknown.

This issue became more visible since 1.6.x allowed to construct such heterogeneous arrays without specification of dtype=object:

>>> import numpy as np
>>> print np.__version__
1.7.0.dev-3cb783e
>>> a = np.array([np.array([0, 1]), np.array(1)])
>>> print a.dtype
object
>>> print a == a.copy()
[ True  True]
>>> print a == np.array([np.array([0, 1]), np.array(1)])
False

So -- comparing an object array to itself's copy worked just fine but comparison to identically created another one -- failed.

Edit: (mattip, 2019-10-28) formatting

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