Course 2: Week 4 - Final Assignment 'The same result as in test, but is not counted as passed'''

Hello. Almost in each grading assignment I accomplish a task, get the expected result but it does not show me = “All passed”. I spend time trying to find out where exactly the problem is.
But when I look at the hints, it turns out that I have done it correctly but just in a bit different way.
For example, here:

{mentor edit: code removed}

I wrote a 4 line code using some numpy methods, which made the code easier to read and less in number of lines. But it gave me en error. Then I did it following the hints. It was the same result (both logic and the result of the code as the previous one).
So, the question is - the test methods that are used in the labs check for how similar the code you have written is similar to the ones in the hints?
Or do I face classical problems? (syntax error, code error…etc)

The grader doesn’t look at your code - it only checks the return values.

One problem with your code is you’re using a logical comparison (“==”) to compare floating point values. That is never a good idea. And np.where() may not be a good choice here.

Please don’t post your code on the forum. That isn’t allowed by the community standards.

Thank you for the clarification.

I see, I am sorry for posting the code.
пт, 9 сент. 2022 г. в 16:46, Tom Mosher via DeepLearning.AI <notifications@dlai.discoursemail.com>: