Python for Data Analytics C3M1 Retail Sales Analysis

When running the exercise, sections 5 and 6 experience an error when multiplying units sold by price per unit that do not match the data provided, resulting in errors in grading. I printed the entire amounts list and got 4.949999999999999, 4.9799999999999995 or 6.300000000000001, for 5 pairs (15, 24, 33, 35, 42), all other amounts check out against the provided data. Grader feedback for ex5 is “There was an error grading your submission. Details:
operands could not be broadcast together with shapes (79,) (80,)” and for ex6 the obvious "Failed test case: The variable total_amount from Exercise 6 has a wrong value. Remember you want to add up all the values in amount.

Failed test case: The variable average_price from Exercise 6 has a wrong value. Make sure you are dividing by the total number of items sold, and not the total number of observations. "

Was this the reason for the update to the assignment? If so, is there another patch coming to resolve the error?

Hi Joseph. This lab only uses global variables so don’t worry about that. I think this is the most telling in the feedback:

There was an error grading your submission. Details:
operands could not be broadcast together with shapes (79,) (80,)

Check your solutions from exercises 4 to 5. The two lists should have the same length. Check the rest of your notebook if you accidentally left a command that makes them unequal. I think if you solve that, both exercises will turn out correct in your next submission. Hope this helps.

1 Like

So far as I can see, everything matches save those five data pairs, 79 and 80 look good. All areas before and after these two are working and match output for full points, so I might just need to reset it and start from scratch to see if I’ve got a space or other item I can’t see with my eyes. I’m also going to try and change the code to return answers limited to two decimal places, as that should also resolve the issue.

Thank you for the feedback!

2 Likes