Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BUG: StringDType: integer indexed assignment does not work for arena strings. #27003

Copy link
Copy link
Closed
@egesip

Description

@egesip
Issue body actions

Describe the issue:

When the strings are "allocated" in the arena (len >= 16), assignment through integer indexing does not modify the array.
Curiously, it works with boolean indexing.
Thanks !

Reproduce the code example:

import numpy as np
from numpy.dtypes import StringDType
a = np.array(['a'*16, 'b'*16], dtype=StringDType())
b = np.array(['d'*16, 'e'*16], dtype=StringDType())
a[[0, 1]] = b
print(a) # expecting ['d'*16, 'e'*16], but getting ['a'*16, 'b'*16]
# curiously a[[True, True]] = b works...

Error message:

No response

Python and NumPy Versions:

2.0.1
3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)]

Runtime Environment:

No response

Context for the issue:

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.