我正在使用 neo4j 图形数据库编写一个简单的推荐系统。我使用 py2neo lib,这是我的程序:
...
for m,row in movie.iterrows() :
tx.run(statement1, {"A": row.loc['id'], "B": row.loc['title'], "C": row.loc['IMDb url']})
is_genre = row.iloc[-19:]==1
related_genres = genre[is_genre].axes[0].values
for g in related_genres :
tx.run(statement2, {"A": row.loc['id'], "B": row.loc['title'], "C": row.loc['IMDb url'], "D": g})
if m%100==0 : tx.process()
tx.commit()
然后,出现错误:
Traceback (most recent call last):
File "c:\Users\quy.lv\Desktop\He_thong_goi_y\He_thong_goi_y_phim.py", line 48, in <module>
tx.run(statement2, {"A": row.loc['id'], "B": row.loc['title'], "C": row.loc['IMDb url'], "D": g})
...
TypeError: Neo4j does not support PackStream parameters of type int64
它似乎发生在这一行:
tx.run(statement2, {"A": row.loc['id'], "B": row.loc['title'], "C": row.loc['IMDb url'], "D": g})
任何人都可以帮我解决它。谢谢!