<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sum_by_n(d, w, n):
 """A utility function to summarize a data array into n values after weighting the array with another weight array w Parameters d : array (t, 1), numerical values w : array (t, 1), numerical values for weighting n : integer the number of groups t = c*n (c is a constant) Returns ------- : array (n, 1), an array with summarized values Examples -------- Creating an array including four integers. We will compute weighted means for every two elements. Here is another array with the weight values for d's elements. We specify the number of groups for which the weighted mean is computed. Applying sum_by_n function array([ 5.9, 30. ]) """

    t = len(d)
    h = t // n #must be floor!
    d = d * w
    return np.array([sum(d[i: i + h]) for i in range(0, t, h)])