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

Skip to content

np.equal not implemented for string arrays? #5399

Closed
@argriffing

Description

@argriffing

scikit-learn/scikit-learn#4014

a = np.array(['eggs', 'spam', 'spam', 'eggs', 'spam', 'spam', 'spam', 'spam',
    'spam', 'spam', 'spam', 'eggs', 'eggs', 'spam', 'eggs', 'eggs',
    'eggs', 'eggs', 'eggs', 'spam'],
    dtype='|S4')

b = np.array(['eggs', 'spam', 'spam', 'eggs', 'eggs', 'spam', 'spam', 'spam',
    'spam', 'eggs', 'spam', 'eggs', 'spam', 'eggs', 'spam', 'spam',
    'eggs', 'spam', 'spam', 'eggs'],
    dtype='|S4')

print(a == b)
print(np.equal(a, b))
[ True  True  True  True False  True  True  True  True False  True  True
 False False False False  True False False False]
NotImplemented

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