You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working through some of the tutorials I've been encountering AssertionError when checking my answer against the provided solution. For the most part, I belive the error occurs due to a difference in the number of decimals returned from my code compared to the provided solution. In these cases, the issue has been resolved by replacing == with ≈ (\approx) in the assertion line. However, this does not work in exercise 11.2 in tutorial 12. The exercise is to diagonalize an eigenvector and subsequently asserting it against a provided "solution" matrix. However, running the assertion line returns an AssertionError, when asserting both equality (==) and approximate equality (≈).
I've been reading through my code multiple times now, and I am at a loss at what causes the AssertionError. The values in my diagonal matrix (A_diag) are seemingly identical to the solution matrix, and setting the statement to approximately equal (\approx) renders the same error. My assumption is that I can count out decimal error here, so what may cause the error? Also, even if the assertion renders the statements unequal, why would this will return an error and not FALSE?
The issue lies with the fact that the eigenvalues of A is not equal to the values in the solution matrix. E.g. -128.49322764802145 is not equal to -128.493. The assertion needs to be updated to reflect this. Either
While working through some of the tutorials I've been encountering
AssertionError
when checking my answer against the provided solution. For the most part, I belive the error occurs due to a difference in the number of decimals returned from my code compared to the provided solution. In these cases, the issue has been resolved by replacing==
with≈
(\approx
) in the assertion line. However, this does not work in exercise 11.2 in tutorial 12. The exercise is to diagonalize an eigenvector and subsequently asserting it against a provided "solution" matrix. However, running the assertion line returns anAssertionError
, when asserting both equality (==
) and approximate equality (≈
).I've been reading through my code multiple times now, and I am at a loss at what causes the
AssertionError
. The values in my diagonal matrix (A_diag
) are seemingly identical to the solution matrix, and setting the statement to approximately equal (\approx
) renders the same error. My assumption is that I can count out decimal error here, so what may cause the error? Also, even if the assertion renders the statements unequal, why would this will return an error and notFALSE
?My code example:
FYI: I also posted this issue on StackOverflow.
The text was updated successfully, but these errors were encountered: