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
Hey @skyrack I know it's not very related, but I made some changes to the original notebook, and got a minimal working example on the networkx. So, there is nothing broken, I think. Here's what I'm running locally:
from py2neo import Graph
graph = Graph()
%load_ext cypher
%%cypher http://neo4j:neo4jbinder@localhost:7474/db/data
create
(Neo:Crew {name:'Neo'}),
(Morpheus:Crew {name: 'Morpheus'}),
(Trinity:Crew {name: 'Trinity'}),
(Neo)-[:KNOWS]->(Morpheus),
(Neo)-[:LOVES]->(Trinity)
import networkx as nx
%matplotlib inline
results = %cypher MATCH (n) RETURN n
g = results.get_graph()
nx.draw(g)
When executing g = results.get_graph(), I'm getting
TypeError Traceback (most recent call last)
in ()
4 results = get_ipython().run_line_magic('cypher', 'http://neo4j:password@localhost:7474 MATCH p = (:Person)-[:LIKES]->(:Drink) RETURN p')
5
----> 6 g = results.get_graph()
7
8 nx.draw(g)
/usr/local/lib/python3.6/site-packages/cypher/run.py in get_graph(self, directed)
202 properties = copy.deepcopy(node['properties'])
203 properties['labels'] = node['labels']
--> 204 graph.add_node(node['id'], properties)
205 for rel in item['relationships']:
206 properties = copy.deepcopy(rel['properties'])
TypeError: add_node() takes 2 positional arguments but 3 were given
Any resolution please?
The text was updated successfully, but these errors were encountered: