but in numpy array
Dear Pragya,
thank you for your question, and yes, you are absolutely right. I somehow missed it before, and I will correct it. (but it will not be visible to you until you reset the assignment).
Indeed if you have a 2D array, components m[i,j] will give the element from row i, column j. The correct answer should be :
m1 = np.zeros([3,3]) m1[0,:] = [1,1,0] m1[1,:] = [0,2,1] m1[2,:] = [1,0,1]
m2 = np.zeros([3,3]) m2[0,:] = [1,3,0] m2[1,:] = [3,1,1] m2[2,:] = [1,1,1]
Which will return: [[1. 1. 0.] [0. 2. 1.] [1. 0. 1.]]
[[1. 3. 0.] [3. 1. 1.] [1. 1. 1.]]
best regards,