I am implementing a page rank algorithm the calculation goes as such:
v = 0.8 * nodes * v + ((1 - 0.8) * e/9
v & e or one dimensional matricies and nodes is a matrix. When I define v & e as 1 dimensional matrices manually the end result is a 1 dimensional matrix as it should be. here is code to generate v & e manually:
v = np.matrix([[1/9], [1/9], [1/9], [1/9], [1/9], [1/9], [1/9], [1/9], [1/9]])
e = np.matrix([[1], [1], [1], [1], [1], [1], [1], [1], [1]])
However when I generate it as so I receive a matrix as a result. any one know why that might be?
v = np.zeros((9,1))
for i in range(0,9):
v[i,0] = 1/9
e = np.ones((9,1))