C3_W2 Assignment Exercise 1

I am only having a problem with exercise 1, but am able to get all the other answers correct. When I submit my answers I get this error:

Failed test case: malformed submission for exercise 1. Unable to find answer for 'var' field.. Expected: a numeric answer for the field 'var', but got: None.

Is this something that is a bug in the system? Or is it saying that I got the values wrong? I do have float answers in both the fields for the answer, and I reset the kernel multiple times.

It is very unlikely that this is a bug in the grader. Most likely it indicates that something is wrong with your implementation. There are a number of possibilities, but the top two would be:

  1. You didnā€™t hit ā€œSaveā€ before you clicked ā€œSubmitā€, so the grader is seeing an older incomplete version of your code.
  2. There is something about your code that is not ā€œgeneralā€: it passes the test case in the notebook, but it fails in the grader when it uses a different test case.

You can confirm or deny theory 1) by doing:

Kernel -> Restart and Clear Output
Save
Cell -> Run All

If all the tests still pass, click ā€œSubmit assignmentā€ and then check the grader results. If it still fails in the same way as you show in your initial post, then it means that theory 2) is the likely cause. In that case, check your solution and make sure you do not reference any global variables and did not ā€œhard-codeā€ any assumptions about the nature of the test inputs.

did you use np.var to calculate mean and variance in the first exercise?

Check the function you are using and the correct variable.

Got the answer right! It was literally a wrong answer. I was certain my answers were correct, but they were absolutely not. Now I have to figure out why those answers are correct, but at least I know it isnā€™t a bug. Thanks for the help all.

Let me know if you want me to close out this forum topic or leave it open. Iā€™m not even certain if I have that ability.

1 Like

Thatā€™s great that the suggestions helped get you further. Itā€™s fine to leave the topic open. The history on the forum can be useful to future students. Once you get to the understanding of the final answer, it would be helpful if you can explain what you learned in words without showing the actual solution code. Thatā€™s not always possible, but increases the chances of helping future students if you can. :nerd_face:

Actually now that I think \epsilon harder, do you mean that your original incorrect answer passed the tests in the notebook? If so, that would be important to understand. Maybe the course staff can figure out a way to improve the tests to catch that error. We canā€™t show source code (even incorrect) for solutions here on a public thread, but Iā€™ll send you a private message about this.

Hi,

So this specific notebook has answers that have to be manually added and saved and the code itself isnā€™t graded (although there is a space for the coding to help you come to an answer). I was just confused with the error that I was given as it told me that ā€˜Noneā€™ was passed (although I know for a fact I manually imputed answers for each question).

Iā€™ll be able to pass my notebook over to you in DMs if you are interested. I was literally just coming to the wrong conclusion in my coded cell, and wasnā€™t inputting the values it was expecting.

1 Like