Costs Assertion Error for optimization function

Costs returns the list [array(5.801),array(nan)] instead of the list [array(5.801),array(0.310)]
I getting cost by taking: grads, cost and equaling it to the propagate function
Example:
<grads, cost = propagate(w, b, X, Y)>

The propagate function already passed all tests, and the only way I could think of a potential error is with the cost equation supposed to be using np.dot instead of the element wise multiplication I was using, but if np.dot was used for matrix multiplication A having shape (1,3) and Y having shape (1,3) would cause an error.

Check how you update w and b. This could also pose an error.

A transposition might fix this.

My w and b parameters where updated by
<w=cost-learning_ratedw>
<b=cost-learning_rate
db>

w=cost-learning_rate*dw
b=cost-learning_rate*db

This is incorrect. Check the below image from the assignment:

Thank you so much