unq, unq_idx = np.unique(A[0], return_inverse=True)
unq_sum = np.bincount(unq_idx, weights=A[1])
unq_counts = np.bincount(unq_idx)
unq_avg = unq_sum / unq_counts
unq
unq_avg
average of all rows corresponing to all unique rows