0
我想PageRank MATLAB/Octave implementation转换为Python,但说到:的PageRank 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
一些代码https://gist.github.com/3722398
您需要在报告python异常时包含回溯;它将消除我们猜测的需要。 –
欢迎来到StackOverflow!除了Marijn的建议外,你还应该生成一个可重复使用的例子(我们不知道'N'是什么,必须弄清楚你必须导入'numpy')。此外,这个问题与pagerank没有任何关系。 –
对不起,标题太宽 – David