You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在这一步,报错。
matcher = NodeMatcher(graph)
for i in holder.values:
a = matcher.match("股票",TS代码=i[0]).first()
b = matcher.match("股东",TS代码=i[0])
for j in b:
r = Relationship(j,'参股',a)
graph.create(r)
print('TS',str(i[0]))
graph.create(Relationship(j,'参股',a))
File "E:\Anaconda3\lib\site-packages\py2neo\data.py", line 847, in init
Entity.init(self, (n[0], self, n[1]), properties)
File "E:\Anaconda3\lib\site-packages\py2neo\data.py", line 553, in init
Walkable.init(self, iterable)
File "E:\Anaconda3\lib\site-packages\py2neo\data.py", line 453, in init
_ = node.labels # ensure not stale
AttributeError: 'NoneType' object has no attribute 'labels'
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
我是把代码改成了
for i in stock.values:
a = matcher.match("股票" ,TS代码=i[1]).first()
b = matcher.match("股东" ,TS代码=i[1])
for j in b:
r = Relationship(j ,'参股' ,a)
graph.create(r)
print("TS代码为" + i[1] + "的股票与股东的关系建立成功")
主要是1)在stock_holders.csv里面,TS代码在第二列也就是i[1]
2)如果遍历holder的话要跑16万(i的个数,stock_holders.csv的条目数)*16万(j的个数,股东实体的个数)次,慢的要死;遍历stock是一样的,但是只用跑4千(i的个数,stock_basic.csv的条目数)*16万次
在这一步,报错。
matcher = NodeMatcher(graph)
for i in holder.values:
a = matcher.match("股票",TS代码=i[0]).first()
b = matcher.match("股东",TS代码=i[0])
for j in b:
r = Relationship(j,'参股',a)
graph.create(r)
print('TS',str(i[0]))
graph.create(Relationship(j,'参股',a))
File "E:\Anaconda3\lib\site-packages\py2neo\data.py", line 847, in init
Entity.init(self, (n[0], self, n[1]), properties)
File "E:\Anaconda3\lib\site-packages\py2neo\data.py", line 553, in init
Walkable.init(self, iterable)
File "E:\Anaconda3\lib\site-packages\py2neo\data.py", line 453, in init
_ = node.labels # ensure not stale
AttributeError: 'NoneType' object has no attribute 'labels'
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: