Thanks to visit codestin.com
Credit goes to github.com

Skip to content

__contains__: erroneous broadcasting when operand is a list #10179

@paul-the-noob

Description

@paul-the-noob

This may be related to #3016.

As I understand it arr.contains(item) is implemented as (arr == item).any().

Due to spurious broadcasting this leads to

[5] in array([None, 4, [5]) -> False

and

[5] in array([None, 5, [4]) -> True

Surely, that can't be right.

I'm on Python3.6 and numpy1.13.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions