import numpy as np
n = 4
Let's create an elimination matrix as $M$:
M = np.eye(n)
M[1,0] = 2
M
array([[ 1., 0., 0., 0.], [ 2., 1., 0., 0.], [ 0., 0., 1., 0.], [ 0., 0., 0., 1.]])
Here's a matrix $A$. See if $M$ has the desired effect on $A$:
np.random.seed(5)
A = np.random.randn(n, n).round(1)
A
array([[ 0.4, -0.3, 2.4, -0.3], [ 0.1, 1.6, -0.9, -0.6], [ 0.2, -0.3, -1.2, -0.2], [-0.4, 0.6, -1.7, -0.7]])
M.dot(A)
array([[ 0.4, -0.3, 2.4, -0.3], [ 0.9, 1. , 3.9, -1.2], [ 0.2, -0.3, -1.2, -0.2], [-0.4, 0.6, -1.7, -0.7]])
Next, see if you can build the inverse of $M$:
Minv = np.eye(n)
Minv[1,0] = -2
Minv
array([[ 1., 0., 0., 0.], [-2., 1., 0., 0.], [ 0., 0., 1., 0.], [ 0., 0., 0., 1.]])
M.dot(Minv)
array([[ 1., 0., 0., 0.], [ 0., 1., 0., 0.], [ 0., 0., 1., 0.], [ 0., 0., 0., 1.]])