A = [[1, 1, 1, 2, 3, 1, 2, 3], [0.1, 0.2, 0.2, 0.1, 0.3, 0.2, 0.2, 0.1]]
unq, unq_idx = np.unique(A[0], return_inverse=True)
unq_sum = np.bincount(unq_idx, weights=A[1])
average of all rows corresponing to all unique rows