I am trying to calculate the T_Sum value so that for the values that are greater than the Vals values in Numbers it will just add up to the Vals values for that element. For example, the first element of Vals is 60 and all the values within Numbers are greater than 60 (11 in total), so the result will be 60 * 11. If the Vals value is 105 there are 5 elements that are greater than 105 so the result will be 525. How can I do this without a for loop?
Vals = np.arange(start=60, stop=105, step=5)
Numbers = np.array([123.6, 130, 150, 110.3748, 111.6992976,
102.3165566, 97.81462811, 89.50038472, 96.48141473, 90.49956702, 65])
My attempt
T_Sum = np.ma.masked_array(np.repeat(Numbers[None,:],Vals.size,0),mask=[Numbers<Vals[:,None]]).sum(-1).data
Expected Output
[660, 650, 700, 750, 800, 850, 810, 760, 600, 525]