C1_W3_Logistic_Regression showing error

one of the cell is not running and shows this error:

TypeError Traceback (most recent call last)
in
13 w,b, J_history,_ = gradient_descent(X_mapped, y_train, initial_w, initial_b,
14 compute_cost_reg, compute_gradient_reg,
—> 15 alpha, iterations, lambda_)

in gradient_descent(X, y, w_in, b_in, cost_function, gradient_function, alpha, num_iters, lambda_)
46 if i% math.ceil(num_iters/10) == 0 or i == (num_iters-1):
47 w_history.append(w_in)
—> 48 print(f"Iteration {i:4}: Cost {float(J_history[-1]):8.2f} ")
49
50 return w_in, b_in, J_history, w_history #return w and J,w history for graphing

TypeError: only size-1 arrays can be converted to Python scalars

this code cell is already filled and is uneditable. Please help.

Link to the notebook

Hi @Farhan_Ali1

Make sure that the previous cells are working fine, because, this code snippet uses previously implemented cells that are written by you.

Hope it helps! Feel free to ask if you need further assistance.

This error message means your gradient_descent() function has an error, because the data it returns for J_history has the wrong structure.

Also, posting a link to your notebook is 1) not useful, because we cannot log into your account, so the file is not available, and 2) sharing your code would violate the Code of Conduct.