You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If it sees another dict, that might mean that it switches over to ak.from_iter, which wouldn't be what you want if the arrays are large. It also wouldn't be the right type: struct of arrays versus array of structs.
You see all of the integer types turn into int64 and float32 into float64 because ak.from_iter treats them as Python int and float, which loses dtype. You also see a different structure for the nested object.
I'll raise this as an issue in Awkward, that ak.zipseems to work recursively, but it doesn't, and what it's doing now is misleading. We can continue the discussion there about what the right behavior is—it's not obvious to me. Treating any expected array-like uniformly with ak.to_layout is good for consistency, but your interpretation is natural, too.
Like,
ak.zip
's dict case just callsak.to_layout
on each of the values of the dict.https://github.com/scikit-hep/awkward/blob/6a24ed0d436bcd158f634d9bd9f6d664fff6bd2b/src/awkward/operations/ak_zip.py#L174-L190
If it sees another dict, that might mean that it switches over to
ak.from_iter
, which wouldn't be what you want if the arrays are large. It also wouldn't be the right type: struct of arrays versus array of structs.Yeah, as I thought:
whereas
You see all of the integer types turn into
int64
andfloat32
intofloat64
becauseak.from_iter
treats them as Pythonint
andfloat
, which loses dtype. You also see a different structure for the nested object.I'll raise this as an issue in Awkward, that
ak.zip
seems to work recursively, but it doesn't, and what it's doing now is misleading. We can continue the discussion there about what the right behavior is—it's not obvious to me. Treating any expected array-like uniformly withak.to_layout
is good for consistency, but your interpretation is natural, too.Originally posted by @jpivarski in #213 (comment)
The text was updated successfully, but these errors were encountered: