Slicing with Awkward Arrays versus slicing with NumPy arrays #2973
Replies: 1 comment
-
Hi @dr-stringfellow, thanks for filing a bug report! This is actually a design decision, and not a bug, but I can appreciate that it very much looks like a bug at first glance! You did help me discover a bug in our next version v2, though! Awkward Array builds upon the advanced indexing of NumPy. In NumPy, if you index with a boolean array, the result is a flat array. Because your second If you were to convert your array to a jagged array, then it would index properly. A jagged array is any array with There are some discussions about making this nicer, but for now you need to ensure that I think this does demonstrate that we need to improve the docs here. I was looking for any mention of this behavior, but it is currently missing (at least, in an obvious sense)! https://awkward-array.readthedocs.io/en/latest/_auto/ak.Array.html#nested-indexing |
Beta Was this translation helpful? Give feedback.
-
Version of Awkward Array
1.8.0rc3
Version of numpy
1.21.2
Description and code to reproduce
Casting first as numpy array makes the code crash even though there is an outer cast to ak.Array in both cases
Error
Beta Was this translation helpful? Give feedback.
All reactions