Skip to content

How does how='zip' work exactly? #1134

Answered by jpivarski
sfrances asked this question in Q&A
Discussion options

You must be logged in to vote

I had forgotten about how="zip", and I didn't find it in any documentation: it's not in uproot.TTree.arrays or uproot.interpretation.library.Awkward, but I found the implementation here:

elif how == "zip":
nonjagged = []
offsets = []
jaggeds = []
renamed_arrays = {}
for name, context in expression_context:
array = renamed_arrays[_rename(name, context)] = arrays[name]
if context["is_jagged"]:
if (
isinstance(array.layout, awkward.contents.ListArray)
or array.layout.offsets[0] != 0
):
array_layout = array.layout.to_ListOffsetArray64(True)
else:

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sfrances
Comment options

Answer selected by sfrances
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants