C1_W2_Assignment Exercise 1 incorrect type error

Hi,
i’m grading my C1_W2_Assignment, but on the exercise 1 i’m getting

Failed test case: Array A has incorrect type..
    Expected:
    <class 'numpy.ndarray'>,
    but got:
    <class 'numpy.float64'>.

despite while printing type(A) it’s numpy.ndarray and all test passed

can you help me please?

Thanks
Antonio

I cannot tell from your message which test is failing.

Please post a screen capture image that shows the entire context of the error message.


the test fails because A is not ‘numpy.ndarray’ type but if you see the print that i have put in the code the type is exactly that one.

It appears you have deleted the dtype specification for the A matrix.

Try adding this, it was included in the notebook template:
image

still the same

Interesting.

Have you ever downloaded your notebook ipynb file and worked on it in some other platform (such as VS Code or Colab, or any others)?

Also, did you “Save and checkpoint” before you submitted the last change for grading? The autosave doesn’t always work.



Hi everyone! I’m kinda stuck here with this Error, I did try to fill the gaps at the first time and the same error poped up. Even after rewriting the code to get rid of any bug the error is still there. Any clues? thank you in advance!

it seems like I should import some function for Matrix module, any hint? kinda lost in the sauce rn, not too skilled at numpy :woozy_face:

Where did “import matrix_operations…” come from?

That’s not part of the assignment.

The begining of that cell should look like this:

You only add code inside the function definitions.

No, that is not necessary.

As I said, the same error has been poping up even when I only tried to add code inside the pre defined fields. Thank you anyways :slight_smile:

A few tips on this assignment:

  • Don’t create any new .py utility files.

  • Those three functions - MultiplyRow(), AddRows(), and SwapRows() - should be defined in the cell that I mentioned.
    You just add three lines of code where I’ve indicated.

  • You do not need to import numpy at the beginning of that cell. That is imported by the first cell in the notebook.

  • Every time you open a notebook, you need to run all of the cells starting from the top. This is where the workspace is configured.

  • Do not rename your notebook. You cannot submit a renamed notebook for grading.

  • In general, don’t do more work than is needed. You just have to add the code that completes each task according to the instructions in the notebook.

  • Don’t add any code outside of the START CODE HERE sections.

  • Don’t add any cells.

  • Don’t delete any cells.

At this point it might be best if you delete your current notebook and get a fresh copy (using “Help → Get latest version”) and start over.

1 Like

Thank you! Imma try rn