Stuck in week 2 np programing

There is part of the week 2 programing 4.3 exercise 5 that I am stuck on . The issue is the shape of the array. Y variable is ‘true’ and ‘false’ but I am supposed to use Y in a mathmatic operation A2-Y. It does something, but I don’t know what. The formulas say to transpose some of the variables, but this seems to create an error. I have tried np.transpose and .T but in the end the arrays are the wrong shape and won’t multiply when transposed. I am stuck.

Not sure what you mean by “Week 2 np programming”. Note that in DLS Course 1 Week 2 there are no variables called A2 in that assignment. Maybe you are talking about the Planar Data assignment in Week 3.

There you do encounter A2 - Y in the back propagation function. In order to compute A2 - Y you want A2 and Y to be the same shape, right? They should both be 2 dimensional arrays with dimensions 1 x m, where m is the number of input samples. So what shapes are you getting? You can print the shape by doing this:

print(f"A2.shape = {A2.shape}")

What does that give you?