Closed
Closed
Copy link
Description
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