I have a singe level nested array, and I'd like to calculate the running sum at the deepest level:
<JaggedArray [[0.8143442176354316 0.18565578236456845] [1.0] [0.8029232081440607 0.1970767918559393] ... [0.42036116755776154 0.5796388324422386] [0.18512572262194366 0.31914669745950724 0.13598232751162054 0.3597452524069286] [0.34350475143310905 0.19023361856972956 0.4662616299971615]] at 0x7f8969e32af0>
after doing something like numpy.cumsum(jagged_array)
I'd like to have:
[[0.8143442176354316 1.0] [1.0] [0.8029232081440607 1.0] ...
In short - the running sum at the deepest level (which is restarted with each new "event").
I'm using awkard0
, and the documentation says that broadcast is run at the deepest level, however, I get an error when I tried just handing a JaggedArray
directly to numpy.cumsum
: operands could not be broadcast together with shapes (2,) (3,)
The dataset is large - I'd like to stay within the awkward system - so avoid python loops in processing these.
I think you're just trying to call np.cumsum on each of the lists in your larger list. Let me know if I'm misunderstanding your intention.
In that case