In [2]:
import re
import numpy as np

The below code requires that the user strips all the lines not corresponding to matrix rows, and also that the user deletes the row information up to the colon


In [ ]:
my_array = np.zeros((11, 11))
row = 0
with open('solve.log') as f:
    for line in f:
        results = re.findall('[0-9.-]+',line)
        for column, value in zip(results[::2], results[1::2]):
            my_array[row][int(column)] = float(value)
        row = row + 1

In [18]:
from numpy.linalg import eig

In [20]:
lam, v = eig(my_array)

In [21]:
lam


Out[21]:
array([1.        , 4.91485277, 2.17259155, 1.9999995 , 0.99407845,
       1.08514773, 1.        , 1.        , 1.        , 1.        ,
       1.        ])