How to use the awkward1.Array function in awkward1

To help you get started, we’ve selected a few awkward1 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CoffeaTeam / coffea / coffea / nanoevents / methods / util.py View on Github external
def flat_take(layout):
        idx = awkward1.Array(layout)
        return target._content()[idx.mask[idx >= 0]]
github CoffeaTeam / coffea / coffea / nanoevents / factory.py View on Github external
def globalindex():
            gidx = awkward1.Array(
                awkward1.layout.ListOffsetArray32(
                    awkward1.layout.Index32(source_offsets), index.generator(),
                )
            )
            gidx = gidx.mask[gidx >= 0] + target_offsets[:-1]
            return awkward1.fill_none(awkward1.flatten(gidx), -1)
github CoffeaTeam / coffea / coffea / nanoaod / nanoawkward1.py View on Github external
k[len(name) + 1 :]: arrays[k]
                        for k in arrays
                        if k.startswith(name + "_")
                    },
                    parameters={
                        "__record__": mixin,
                        "events_key": self._keyprefix,
                    },
                )

        events = awkward1.layout.RecordArray(
            {name: collectionfactory(name) for name in collections},
            parameters={"metadata": self._metadata},
        )

        self._events = awkward1.Array(events)
        return self._events