Load an image that represents a graph

In [2]:
from IPython.display import Image
Image(filename='markov.png')
Out[2]:
In [6]:
import numpy as np
In [7]:
A = np.zeros((4,4))
A[1,0] = 0.3
A[0,1] = 1.0
A[1,2] = 0.5
A[1,3] = 0.2
A[2,3] = 1.0
A[3,2] = 1.0
print(A)
[[ 0.   1.   0.   0. ]
 [ 0.3  0.   0.5  0.2]
 [ 0.   0.   0.   1. ]
 [ 0.   0.   1.   0. ]]
In [ ]: