Skip to content

BUG: StringDType Subscript assignment problems #27053

Description

@ngoldbaum

Following on from #27003,

    a = np.array(['', ''], dtype='T')
    a[[0, 1]] = ['a'*16, 'b'*16]
    print(a)  # getting ['', '']

Note that both a[[0, 1]] = ['a', 'b'] and a[[0, 1]] = np.array(['a'*16, 'b'*16], dtype='T') work (the latter one thanks to the current fix).

And worse, if a has some non-empty values, I get a crash (I am on Windows):

    a = np.array(['a', 'b'], dtype='T')
    a[[0, 1]] = ['a'*16, 'b'*16] # crash

Originally posted by @egesip in #27047 (comment)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions