我想将PageRank MATLAB/Octave 实现转换为 python,但是涉及到:
a=array([[inf]])
last_v = dot(ones(N,1),a)
有一个TypeError
。
Traceback (most recent call last):
File "/home/googcheng/page_rank.py", line 18, in <module>
pagerank(0,0)
File "/home/googcheng/page_rank.py", line 14, in pagerank
last_v = dot(ones(N,1),a)
File "/usr/lib/python2.7/dist-packages/numpy/core/numeric.py", line 1819, in ones
a = empty(shape, dtype, order)
TypeError: data type not understood