Skip to content

surpport bool index #32

@zhaominxing208

Description

@zhaominxing208

for example:
n [112]: arr = np.arange(12).reshape(3,4)

In [113]: i = np.array([True,False,True])

In [114]: i.nonzero()
Out[114]: (array([0, 2]),)

In [115]: arr[i]
Out[115]:
array([[ 0, 1, 2, 3],
[ 8, 9, 10, 11]])

In [116]: arr[i.nonzero()]
Out[116]:
array([[ 0, 1, 2, 3],
[ 8, 9, 10, 11]])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions