Refreshing Notebook

Hi, I’m having trouble refreshing the notebook for the " Chest X-Ray Medical Diagnosis with Deep Learning" assigment. I have tried the instructions on “How to refresh your workspace” but the notebook still comes up with all the code solutions already preloaded (as in the attached image). I thought the workspace is supposed to be a space for me to write and enter codes. What am I doing wrong?

Hi @niheon You’re not doing anything wrong. All assignments are designed like that. Some cells are prefilled for you. You will add your code to graded assignments. You will see something like this: “START CODE HERE (REPLACE INSTANCES OF ‘None’ with your code)”
I hope this helps, even though I understand you would prefer to write your own code from scratch.


OK, thank you very much. I appreciate it.

Take a look at this screenshot. I get an error when I try to read the files from the given paths. How can I resolve the problem? I’m thinking of downloading and reading the files locally but thought I should ask first.

I figured it out. I needed to run the first cell to import the necessary libraries first.

1 Like

Hi niheon, greetings! Have you imported library pandas before running this cell? In case you did not, the error is possibly because of that. Try once again by importing pandas as pd. But, I guess the code is already written in your assignment. You simply need to run the cell. Do, let me know if the issue is not resolved.
Best regards,

1 Like

Hey @niheon
Coursera assignments for the specialization courses are all designed this way. The cells come with some code written and there are indicators for the student about which part/function of the code they will be writing. The indicators are often in the form of comments, and the code is given in order to add context and simplify the assignment.
Hope this helps!

1 Like

I’m stuck on Week 1 Exercise 2 - Computing Class Frequencies. I’m getting different positive and negative frequencies compared to the expected output (see attached images). I believe my code is the problem. Could someone please have a look at it and help me out.

Hello @niheon!
You have made a mistake for calculating N
If you use np. sum it will calculate the total number of 1’s in each column. Which is also the same as positive_frequencies.

Try taking the first item (zeroth index) of the shape of labels for N.


I can’t believe this took me more than 2 hours to figure out! I was thinking about that but I kept using y.shape[0] instead of labels.shape[0] for N.


1 Like

You’re welcome :grinning:.
While creating a question post it as a new topic as it will be useful to keep track of it and mark it as solved.