On the last assignment of the first course and I couldn't get through the python lab

When creating a post, please add:

  • Week # must be added in the tags option of the post.
  • Link to the classroom item you are referring to:
  • Description (include relevant info but please do not post solution code or your entire notebook)
  • C1_W3_Logistic_Regression
  • I tried to run most of the code in the python lab but all I got was errors and I couldn’t complete the last assignment which made me not to earn my certificate
  • please can I do.

Please post a screen capture image that shows the error messages.

Hello, here is a screenshot attached to this email

(attachments)

Tip:
Every time you open a notebook, you must run all of the cells starting from the top of the file.

I would guess you’re getting that error message because you did not run the cell that imports some of the assignment files.

When I start running the cells from the beginning of the file some of the codes were good and gave me expected results but at the 4th, 5th and 6th questions the codes threw error. Please what can I do?

I think that means the code that is running (or is called from) those cells has an error.

Please post a screen capture image of any error messages. Please do not post images of your entire code.

I will get back to you with the errors thrown back in few hours. I have been busy with studies of the course 2.

Here are some of the errors I encountered





Tip:

Every time you open a notebook, you must run all of the cells starting from the top of the file. The first few cells is where the assignment assets are imported and the workspace is configured.

2 Likes

Hi Olayiwola and welcome to the community!

@TMosh is right! Please run all the cells from the top, which probably caused the missing definitions for some functions and variables. Make sure you start from the beginning next time to avoid these errors.

If I understood you both correctly, you’re are saying I should select all the cells together and run them all at a go starting from the top?

@Ola_12 I don’t have a window open in front of me, but vaguely remember-- If you click in to any cell, and then from the run ‘drop-down’ menu you can select ‘run everything above’. That should get you there.

No, not “select all the cells together”.

Go through each cell in sequence and click the “Run” button for each one.

(as Nevermind says, there are other tools available to automate the process).

But it’s good to review the results of each cell and verify you’re getting the expected results.

@TMosh, no I agree, it seems like they are not loading required libraries/helper functions somehow. Best to start from the beginning.

1 Like

Please give me a moment let me go over it again and feed you back on my results. I don’t want to be stuck again in course 2

The procedure is the same for every assignment.

  • Always run all of the cells every time you open a notebook.

You cannot find success without this.

1 Like

Okay, please how do I return back to the default codes I think I must have altered some of the codes in pursuit of a good result.

@Ola_12 I’m not sure if this is the latest update, but this should help:

1 Like

Use the “File->Open” menu.
Find your notebook ipynb file.
Check the box next to it, and then delete the file.

Now go to the Labs Help menu (the question-mark inside a circle), and use “Get latest version”. This will give you a new copy of the notebook.

1 Like

Thank you so much guy. I followed all your instructions and guidelines and I was able to complete my assignment after a long while of been stuck. I have also received my certificate. God bless you guys. Tmosh and Nevermind

1 Like