ID
value
unqID, idx, IDsums = np.unique(ID, return_counts=True, return_inverse=True)
{i: (IDsums[itr], value_sums[itr]) for itr, i in enumerate(unqID)}
Summing data from array based on other array in Numpy