W2_A2_Attribute Error_'append'


I have a problem in

Exercise 6 - optimize

I have a error:
in optimize(w, b, X, Y, num_iterations, learning_rate, print_cost)
53 # Record the costs
54 if i % 100 == 0:
—> 55 costs.append(cost)
57 # Print the cost every 100 training iterations

AttributeError: ‘numpy.ndarray’ object has no attribute ‘append’

I dont’t change a costs = . Why it is numpy.ndarray, instead list?

Can anyone help?

My code:

{moderator edit: code removed}

Thank you in advance.

Welcome to the forum!

Looks like maybe you’re using the wrong variable name.

Note also, please don’t post your code on the forum. That’s not allowed by the Code of Conduct.

If a mentor needs to see your code, we’ll contact you with instructions.

Thank you. This solved my problem.

Sorry for post my code on the forum.

No problem!