def org_app1(matrix, nr):
    A = np.zeros((nr - 1, nr))
for x in range(matrix.shape[0] - nr + 1):
    newrow = np.transpose(matrix[x:x + nr, 2:3])
A = np.vstack([A, newrow])
return A

def vect_app1(matrix, nr):
    col2 = matrix[:, (2)]
nrows = col2.size - nr + 1
out = np.zeros((nr - 1 + nrows, nr))
col2_2D = np.take(col2, np.arange(nrows)[:, (None)] + np.arange(nr))
out[nr - 1:] = col2_2D
return out

def vect_app2(matrix, nr):
    col2 = matrix[:, (2)]
nrows = col2.size - nr + 1
out = np.zeros((nr - 1 + nrows, nr))
n = col2.strides[0]
col2_2D = np.lib.stride_tricks.as_strided(col2, shape=(nrows, nr), strides=
    (n, n))
out[nr - 1:] = col2_2D
return out
Numpy conversion of column values in to row values