diff --git a/awkward/array/jagged.py b/awkward/array/jagged.py index fd334209..d23b3e34 100644 --- a/awkward/array/jagged.py +++ b/awkward/array/jagged.py @@ -879,7 +879,10 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): if parents is None: parents = jaggedarray.parents - good = (parents >= 0) + if self._canuseoffset() and len(jaggedarray.starts) > 0 and jaggedarray.starts[0] == 0: + good = None + else: + good = (parents >= 0) def recurse(x): if isinstance(x, awkward.array.objects.ObjectArray): @@ -891,6 +894,13 @@ def recurse(x): content[n] = recurse(x[n]) return content + elif good is None: + if len(x.shape) == 0: + content = self.numpy.full(len(parents), x, dtype=x.dtype) + else: + content = x[parents] + return content + else: content = self.numpy.empty(len(parents), dtype=x.dtype) if len(x.shape) == 0: diff --git a/awkward/version.py b/awkward/version.py index c2531635..6ec4af9c 100644 --- a/awkward/version.py +++ b/awkward/version.py @@ -30,7 +30,7 @@ import re -__version__ = "0.8.2" +__version__ = "0.8.3" version = __version__ version_info = tuple(re.split(r"[-\.]", __version__))