-
-
Notifications
You must be signed in to change notification settings - Fork 357
Closed
Description
After 7c31f04 there was a breaking change to indexing behavior when a numpy integer type is passed:
For the following array:
z = zarr.group()
a = z.create_dataset("test",shape=(10,))
a[:]=range(10)
Before this commit:
a[np.int64(1)]
has the value 1.0
After:
a[np.int64(1)]
has the value [1.]
For both cases a[1]
stays as 1.0
as expected. Was this change expected? This happens a lot when iterating over one numpy array and indexing with it as the iterable is of the numpy type. The fix in our application was to cast to a python int
before indexing.
EDIT: Also note that numpy indexing returns the single value as was the case before this commit.
jeromekelleher and Onkar627
Metadata
Metadata
Assignees
Labels
No labels