scikit-hep / awkward-0.x

Manipulate arrays of complex data structures as easily as Numpy.
BSD 3-Clause "New" or "Revised" License
215 stars 39 forks source link

IndexError when masking empty jaggedArray made from offsets #239

Open jrueb opened 4 years ago

jrueb commented 4 years ago

I'm trying to apply a mask onto my JaggedArray. Unfortunately, in the corner case where the JaggedArray is empty, I can an IndexError.

a = awkward.JaggedArray.fromoffsets([1, 1], [1, 1])
mask = a > 10
a[mask]

In case of arrays created by fromcounts, this seems to work.

jpivarski commented 4 years ago

Awkward 1 is so close to being ready that my recommendation is to use the work-around. (Leave this issue open so that anyone else who runs into this can find it.)

Thanks for reporting it, though!