a = np.array([[0, 1/2, 0, 1/2, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [1/6, 1/6, 1/6, 1/6, 1/6, 1/6]]) ret = np.linalg.eig(a.T) pr = np.abs(ret[1][:, 0] / np.sum(ret[1][:, 0])) for i in range(6): print("node ", i, ":", '{:.3f}'.format(pr[i])) node 4 : 0.061 node 5 : 0.364 node 1 : 0.303 node 0 : 0.061 node 3 : 0.152 node 2 : 0.061