How to use the awkward1.layout.ListOffsetArray32 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 / nanoaod / nanoawkward1.py View on Github external
def _listarray(self, counts, content, recordparams):
        offsets = awkward1.layout.Index32(
            numpy.concatenate([[0], numpy.cumsum(counts)])
        )
        length = offsets[-1]
        return awkward1.layout.ListOffsetArray32(
            offsets,
            awkward1.layout.RecordArray(
                {k: _with_length(v, length) for k, v in content.items()},
                parameters=recordparams,
            ),
github CoffeaTeam / coffea / coffea / nanoevents / factory.py View on Github external
def _listarray(self, offsets, content, params):
        offsets = awkward1.layout.Index32(offsets)
        length = offsets[-1]
        if isinstance(content, dict):
            content = awkward1.layout.RecordArray(
                {k: _with_length(v, length) for k, v in content.items()},
                parameters=params,
            )
            return awkward1.layout.ListOffsetArray32(offsets, content)
        return awkward1.layout.ListOffsetArray32(offsets, content, parameters=params)
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 / nanoevents / factory.py View on Github external
def _listarray(self, offsets, content, params):
        offsets = awkward1.layout.Index32(offsets)
        length = offsets[-1]
        if isinstance(content, dict):
            content = awkward1.layout.RecordArray(
                {k: _with_length(v, length) for k, v in content.items()},
                parameters=params,
            )
            return awkward1.layout.ListOffsetArray32(offsets, content)
        return awkward1.layout.ListOffsetArray32(offsets, content, parameters=params)