Nicholas Smith
Nicholas Smith
One argument against `[None]` is that it is the only one that produces masked values after flattening on axis 1: ``` >>> ak.flatten([[1], [4], [None]], axis=1) >>> ak.flatten([[1], [4], []],...
I disagree, flatten almost always alters the broadcast-compatibility of arrays. Meanwhile `ak.firsts` can maintain the structure (in both cases).
Interestingly, `ak.concatenate` with `axis=-1` would be implementable with `ak.stack(ak.zip([a, b, c]))`. For other axes, I think the more generalized pandas `pivot` method would need to be implemented: it can map...
If I understand right, you need to resolve this cross-reference `sim_id_gem_cluster` into the appropriate entry in the `gem_cluster` array? This is a pretty common pattern in e.g. CMS NanoAOD (see...
In general, these sort of "build-up structure" operations are part of what the NanoEvents schema classes are trying to abstract, but it would be nice if awkward-array made a few...
Hi, Yeah it should have been a reduction along `axis=2`, that was my mistake. For a new index array, you have to re-compute the global index with respect to the...
If you're interested, coffea NanoEvents allows you to do things like the above, with the addition of _lazy access_, which means the destination collections of such cross references are not...
Well I provided a reasonably general solution in the self-contained `embed_crossref` function above, and there is a lazy equivalent in NanoEvents, I'm not sure if that qualifies? I would leave...
Hm for me it was ok, the assertions just guard against indexes out of bounds (so maybe your nTuples have some bug?) I guess they could be simplified though, to...
We implement this vector sum as a mixin method in coffea vector classes: `array.sum(axis=1)` simply sums each cartesian component: e.g. this 2-vector implementation [copied from here](https://github.com/CoffeaTeam/coffea/blob/b644bcf2b48e272e6c78e4b1ddee3c233a67022d/coffea/nanoevents/methods/vector.py#L156-L166) ```python def sum(self, axis=-1):...