since arrays is the same as the else block, it might be better to just change the if to something like:

    if len(others) and isinstance(others[0], (list, np.ndarray))