Can someone please assist? My calcs seem to be correct, just not sure why I my cost variable is resulting in an array. I can provide my code sample if needed.
If you use np.sum without the axis or keepdims option, you will get a scalar regardless of the shape of the input. The problem is that the code you wrote does not do what you intended. Superficially it looks correct, but check the matching of the parens there. The np.sum only includes the first term, so you end up with a scalar plus a 1 x 3 vector. The notebook editor is syntax aware: click on a paren and it will highlight the matching one.
Glad to hear you got it to work. Programming can be frustrating because it requires both high level conceptual understanding and at the same time absolute attention to the most nitty gritty details. A paren in the wrong place or the difference between ; and : can ruin everything.