I have a numpy array as the following:
import numpy as np
arr = np.array([np.array([1]),np.array([1,2]),np.array([1,2,3]),np.array([1,3,4,2,4,2])])
I want a nice numpy function, which gives me the maximum length of the arrays inside my arr array. So I need a numpy function, which return for this example 6.
This is possible with iteration, but I am looking for a nicer way, perhaps even without map()
Any function inside tensorflow or keras would also be possible to use.
list, and that particular list has no way of being transformed in any straightforward way into anumpyarray (irregular dimension).max(len(a) for a in arr)? Also,arrcan't be a numpy array, only withdtype=object.np.arrays? I don't see any.arr = [[9999],[2,2,2,2,2],[1,1]]it would have returned1.