C1_W2_Linear_Regression Jupiter cannot read the code written by lectrurer

**In practical assignment for the 2-nd week JupiterNotebook cannto read lecturer`s code. Why is that?
**

NameError Traceback (most recent call last)
in
3 initial_b = 1
4
----> 5 cost = compute_cost(x_train, y_train, initial_w, initial_b)
6 print(type(cost))
7 print(f’Cost at initial w: {cost:.3f}')

NameError: name ‘x_train’ is not defined

@oleksandrlukovyna,

I’m not sure I’m understanding your question, but the error message you are seeing says that x_train is not defined, which sounds like you didn’t run the cell above where x_train is assigned a value. When you work on an assignment, you need to run every cell in order from the beginning.

3 Likes

Thank you! It caused me so much headache, you wouldn’t believe

1 Like