Week 2: exercise 3: NameError: name 'sigmoid_test' is not defined

hi peers,

while I execute this code sigmoid(t_x) is printed, however I receive this error afterwards ‘NameError: name ‘sigmoid_test’ is not defined’, here is the code:

what am I missing?

cheers,
Alex

1 Like

Welcome, @Alexander_Polevoy. You have not executed the very first code cell of the notebook that contains all of the import statements. You have received a NameError because that function is not in the “namespace.” The critical line in this case is from public_tests import *. From the cell that you are trying to execute, you could select “Cell → Run All Above” rather than manually executing each individually.

P.S. It is a violation of the honor code to post your code. You are (strongly!) encouraged to post the traceback, however. Which you have done. Thanks!

1 Like

Hi @kenb,

thank you very much for your help. Noted on posting the code here, I will be more careful going forward.

Cheers,
Alex

Hello! Mr. Kenb Thank you for the solution, I understand this is a basic and previously solved issue. I might be missing something.
In my case despite following the solution of running cells above or cells doesn’t seem to get past this error. Is there any workaround for this ?
Other cells in notebook seem to run and show “all tests have passed” except this

If you have ran all the above cells and still getting this error, then you might deleted/modified the cell that import or define that function. Check this post to get a fresh copy of your notebook and do your code again.