Error in c1w1 assignment

n_bedrooms = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], dtype=float)
price_in_hundreds_of_thousands = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], dtype=float)

Error - Failed test case: incorrect values for price_in_hundreds_of_thousands tensor.
Expected: a numpy array with values of the prices for houses with 1 up to 6 bedrooms
Got: [1. 2. 3. 4. 5. 6.]

You filed this question under DLS Course 1, but I don’t recognize this problem. I’m guessing you are talking about MLS Course 1. If I’ve got that right, it would be a good idea to edit the category on the title to make sure the right people notice your question. You can use the little “edit pencil” on the title to do that. Or let me know and I can do it for you.

This query is from tensorflow developer professional certificate specialisation, course 1 introduction to tensorflow.

your values for price_in_hundreds_of_thousands is incorrect. read the first paragraph at the top of assignment notebook which explains the relation of how increase in bedroom increases bedroom price to 50,000. So for 1 bedroom if the price is 100,000. For 2 bedrooms, price would be 150,000 and not 200,000. So using price in hundreds as 2 would be incorrect value, causing the error you encountered.

For now I am moving your query to right category, but be careful from next time when you post your query and select right course and specialisation.

Here is another explanation

1 Like

price_in_hundreds_of_thousands = np.array([100, 150, 200, 250, 300, 350]) / 100
This worked!

did you pass the assignment with that??

I thought the solution is so simple.

codes removed as it is part of the grade function codes which asses your assignment grade. If a mentor wants to look at your code, they will ask you to send the codes by personal DM. If you have failed test, share screenshot of the failed test results instead of sharing codes.

But I am getting the following error.
Failed test case: incorrect values for price_in_hundreds_of_thousands tensor.
Expected: a numpy array with values of the prices for houses with 1 up to 6 bedrooms
Got: [150000. 200000. 250000. 300000. 350000. 400000.]

I was thinking thats the expected output, but seems there is some error.
Can someone guide me here please.

hi @uttkarsh81

Welcome to discourse community as you are a new user just few important information. No part of grade function codes is allowed to be shared, posted or exchange on public post threads. If a mentor wants to look at your codes, they will ask you to send the code screenshot by personal DM to review your code are correct or not.

Also Kindly always create a new topic even if you find similar query threads to your problem. You can always share the similar thread links in your created post when you raise a query or issue.

Now comes to your code, I have shared a previous thread link here which would have explained you how to write the code correctly but just in case you missed that, I am sharing here in this response, refer it

Solution explained

Let me know if you still want me to check your codes once.

regards
DP

1 Like

closing this thread as the learner created new topic and his issue is resolved.