Say we have a jagged array that looks like this:
arr = ak.Array([[1, 2, 3], [3, 2], [], [5], [6, 9, 6, 9]])
We can see that it has a depth of 2. Is there something like a single or combination of built-in functions that would tell me that?
ak.size requires that I already know the depth and ak.to_numpy -> np.size would give me an error for incompatibility. I'm looking for something inbuilt because I need it to be fast.
Thanks!
Edit: I forgot to mention that I would like to solve this in the case where the given array is guaranteed to have a uniform depth and consists entirely of numbers.
Simple code which does this -
Example-
Hope this helps :)