Вот общий и в основном нумфитонический подход:
In [144]: def array_packer(arr):
...: cols = arr.shape[1]
...: ids = arr[:, 0]
...: inds = np.where(np.diff(ids) != 0)[0] + 1
...: sp = np.split(arr[:,1:], inds)
...: result = [np.unique(a[: cols]) if a.shape[0] >= cols else
...: np.pad(np.unique(a), (0, (cols - 1) * (cols - a.shape[0])), 'constant')
...: for a in sp]
...: return result
...:
...:
Демо:
In [145]: a = np.array([[1, 12, 15, 45],
...: [1, 13, 23, 9],
...: [1, 14, 14, 11],
...: [2, 13, 90, 34],
...: [2, 14, 23, 43],
...: [3, 11, 123, 53]])
...:
In [146]: array_packer(a)
Out[146]:
[array([ 9, 11, 12, 13, 14, 15, 23, 45, 0, 0, 0]),
array([13, 14, 23, 34, 43, 90, 0, 0, 0, 0, 0, 0]),
array([ 11, 53, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0])]
In [147]: a = np.array([[1, 12, 15],
...: [1, 13, 23],
...: [1, 14, 14],
...: [2, 13, 90],
...: [2, 14, 23],
...: [3, 11, 123]])
...:
...:
...:
In [148]: array_packer(a)
Out[148]:
[array([12, 13, 14, 15, 23]),
array([13, 14, 23, 90, 0, 0]),
array([ 11, 123, 0, 0, 0, 0])]