I’m sorry I really cannot comprehend here I did pass it as tuple. this is in my code: A_system = np.hstack((A, b.reshape((4, 1)))) the below code was provided in “C1_W2_Lab_1_solving_linear_systems_3_variables” A_system = np.hstack((A, b.reshape((3, 1)))) both are the same what i’m I missing ?. I added print statements to check if the matrix is correct it turns out be correct
{code removed by mentor}
. Please find the screenshot here
I have seen the code of other members who posted. It’s same. I still can’t figure it out. please help me out.
I don’t mentor this course, but the thing I notice from your code is in the last line for multiplying row 3 by -1/17, it replaces the matrix with a row. You are not asked to replace the matrix with a row, but to modify its row 3.
The replacement can explain why your resulting A_ref’s shape is the shape for just one row, but not the shape for a matrix, which is expected.
As a mentor and a learner, I believe post-mortem may be useful. I know you have spent 2 days on it, but when you are ready, I am going to share how I noticed it.
I don’t mentor this course, so what you shared is literally all I know about that exercise. I did the following:
Your printed messages are very helpful and gave me some context. I believe those were Tom’s suggestions?
I read through all those instructions and none suggests that the shape should change - so my focus becomes: what can change the shape?
I listed the only 4 operations ever used - SwapRows, AddRows, +=, and =
I don’t know if SwapRows and AddRows can go wrong, but for += and =, I can know immediately.
If I didn’t spot anything, I would have asked you to print each A_ref after it is changed, not just A_system and the final A_ref, but every single one in the middle. With those additional prints, I can inspect every one of them and find out which has the problem.
Therefore, even if I had missed it in step 4, I could have found it in step 5. Step 5 looks time-consuming, but that definitely takes less than 2 days
Good luck!
Raymond
PS: I am going to remove assignment codes that are not allowed to share here for you.