[py2neo]TypeError: Neo4j does not support JSON parameters of type int64
2020-02-04 03:43
2735 查看
按以下代码创建了几个节点
[code]from py2neo import Node,Relationship,Graph,Subgraph graph = Graph("http://localhost:7474",auth=("neo4j","123")) a = Node("Person", name="Alice") b = Node("Person", name="Bob") c = Node("Person", name="Jim") d = Node("Person", name="Nacy") nodes=Subgraph([a,b,c,d]) graph.create(nodes)
假如有一个DataFrame如下
现根据DataFrame的值添加age属性,代码如下
[code]node=graph.nodes.match("Person",name="Alice").first() node['age']=df_age.ix['Alice','age'] graph.push(node)
代码报错:TypeError: Neo4j does not support JSON parameters of type int64
很奇怪,我的属性赋值明明是数字,报错说不支持json参数。那我再int一下变量,这样可能支持。
[code]node=graph.nodes.match("Person",name="Alice").first() node['age']=int(df_age.ix['Alice','age']) graph.push(node)
不再报错,问题解决。
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- [Python] [py2neo][neo4j] TypeError: Parameters of type map are not supported
- ERROR: The version of SQL Server in use does not support datatype 'datetime2'.
- 使用numpy库报错,TypeError: Object of type 'int64' is not JSON serializable.
- Error: The version of SQL Server in use does not support datatype 'datetime2'
- Error: The version of SQL Server in use does not support datatype 'datetime2
- TypeError: 'dict_keys' object does not support indexing
- TypeError:’str’ does not support the buffer interface
- Python 3中套接字编程中遇到TypeError: 'str' does not support the buffer interface的解决办法
- TypeError: 'ItemMeta' object does not support item assignment
- ERROR tool.ImportTool: Import failed: java.io.IOException: Hive does not support the SQL type for co
- TypeError:Object of type 'datetime' is not JSON serializable 和 json.dumps函数输出中文乱码解决方案
- python2.7web代码用python3.6运行时,浏览器发送请求报错TypeError: Object of type 'bytes' is not JSON serializable的解决办法
- Python3 flask 解析post的json数据时报错,TypeError: Object of type 'bytes' is not JSON serializable
- python——TypeError: 'str' does not support the buffer interface
- TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int
- Python错误:TypeError:'str' does not support the buffer interface
- This EntitySet of Type 'Data.Tbl_Student' does not support the 'Add' operation.原因
- theano 中出现 TypeError: 'TensorVariable' object does not support item assignment
- TypeError: Object of type 'float32' is not JSON serializable
- Python笔记002——错误TypeError: 'str' does not support the buffer interface