I would like to find a way to quickly manipulate an array of arrays in Numpy like this one, which has a shape of (10,):
[array([0, 1, 3]) ,array([0, 1, 7]), array([2]), array([0, 3]), array([4]),
array([5]), array([6]) ,array([1, 7]), array([8]), array([9])]
For instance, I'd like to compute the total number of array elements, which is 16 for the array above, but without doing a for loop since in practice my "nested array" will be quite large.
Thanks!
np.frompyfuncmay be useful in some cases, with a modest speed difference.