W2_A2_Ex-5_Value Error_shapes (1,3) and (1,3) not aligned

It is fine to use np.dot to compute the cost, but you need to understand how dot products work. It doesn’t make sense to dot a 1 x 3 vector with a 1 x 3 vector, right? For dot product to work, the “inner” dimensions need to match. So how could you get that to work? Are you familiar with the “transpose” operation?

This question comes up frequently. Here’s an earlier thread that discusses it in more detail.