UFuncTypeError Traceback (most recent call last)
in
1 # Test your solution
----> 2 w2_unittest.test_augmented_to_ref(augmented_to_ref)
~/work/w2_unittest.py in test_augmented_to_ref(target)
342
343 for test_case in test_cases:
→ 344 result = target(test_case[“input”][“A”], test_case[“input”][“b”])
345
346 try:
in augmented_to_ref(A, b)
38
39 # multiply row 3 of the new matrix A_ref by -1/17
—> 40 A_ref[3] *= (-1/17)
41 ### END CODE HERE ###
42 return A_ref
UFuncTypeError: Cannot cast ufunc ‘multiply’ output from dtype(‘float64’) to dtype(‘int64’) with casting rule ‘same_kind’
The code you write in Exercise 3 should use only the parameters that are passed to each function.
That matrix is referred to as “M”, and the first thing each function does is create a copy called “M_new”.
Your code should modify the matrix M_new.
To test your code, Exercise 3 uses its own matrix “A_test”.
No matter how many times I correct the code I still get the wrong answer for Exercise 3 onwards. Is there anyway you can help? (Been at it for 2 weeks now)