lens = np.array([len(i) for i in ll])
mask = lens[:, (None)] > np.arange(lens.max())
mask
idx = np.where(mask.ravel())
idx
efficiently convert uneven list of lists to minimal containing array padded with nan