Вот мой ответ:
`def partialMatrix(arr, row, col):
row -= 1
col -= 1
adjointArr = np.zeros((arr.shape[0]-1, arr.shape[1]-1))
r, c = 0, 0
for i in range(len(arr)):
if i != row:
for j in range(len(arr)):
if j != col:
adjointArr[r][c] = arr[i][j]
c += 1
r += 1
c = 0
return adjointArr`
`def cofactor(partial, row, col):
return (-1) ** (row + col) * np.linalg.det(partial)`