Week 2, Exercise 8-L1, Must return Float

In this Python Basic exercise,

I used np.subtract() do the vector subtract: y_hat minus y

then i used np.abs() on the resulting vector.

loss = np.abs( np.subtract(y_hat, y) )

Can you give me a hint on how to get to the float so that I can return it?

Thanks!

I figured it out!

I needed to call np.sum()

:slight_smile: