Given ids (1-D int in [0, k)) and amounts (1-D float, same length), return a float array of length k giving each id's mean amount, with np.nan for ids having no rows.
Input
ids = [0 0 2]
amounts = [10. 20. 5.]
k = 4
Output
[15. nan 5. nan]