Error: There was a problem grading your submission. Details: sub got incompatible shapes for broadcasting: (5,), (50,)

this error keeps popping up despite using fresh notebook, fresh w1 checking file. is there any way of fixing it?

It may have to do with your solution. Did you pass all the test cases before submitting?

it does pass them
изображение

when you converted the prices, did you apply the correct datatype whenused np array?

it should have been np.array(Price_A).astype(‘float32’)

yeah, I did, but it shows the error with shapes, despite both being (50, )

remember price_A is df.price_supplier_a_dollars_per_item and Price_B is df.price_supplier_b_dollars_per_item


I’m sure solution is right, it seems to be grading issue

grading issue usually happens if

you are using global variables instead of local variables.

if you have hard coded any of the codes.

if you have edited anything outside the markers ###START AND END CODE HERE###

if there was any editing done in the test cell.

Passing all test doesn’t always mean your codes are correct.

Please send screenshot of your codes by personal DM. click on my name and then message.

These courses have been in use for a while and many people have used the grader succesfully. It could be that you’ve done something new and creative that uncovers a previously unknown bug in the grader, but the probability of that is pretty small.

I’ll bet that your solution is not fully correct. Please check the things that Deepti mentioned. The chances are that you’ve written your code in a way that is specific to the test case in the notebook, but the grader uses a different test case and that fails.

issue is resolved paul, he had restarted the kernel, and the exercise was not converting the datatype in the require float type, even if his codes were correct. He also had some issue in exercise 4, which he resolved himself by suggestion to avoid global variables and understand array where not just omega array, pA and pB but relative to their index positioning.

2 Likes

Hello sir , I have Problem with C2 W1. All test cases are passed but the grade for Excersice 01 is 0.I will attach the snapshot with this.
I edit the code outside #Start code here# and hardcode some codes.

hi @Ushan_Loshitha

You probably mixing the variables. check if you aren’t using global variabiles.
In case not able to find, please click on my name and then message screenshot of the grade cell codes.

Also kindly create always a new topic even if you find similar thread as it will help you to save your learning journey and don’t confuse future learner with issues and solutions. You are a new learner, so it’s okay for the first time as you might not know community guidelines on how to use forum.

Regards
DP

closing this thread as his issue is addressed in his created post