Skip to content

Instantly share code, notes, and snippets.

@infinite-Joy
Created November 2, 2018 15:59
Show Gist options
  • Save infinite-Joy/b1acf67b4e959d7efa06c5dc4286eba5 to your computer and use it in GitHub Desktop.
Save infinite-Joy/b1acf67b4e959d7efa06c5dc4286eba5 to your computer and use it in GitHub Desktop.
print('Create the edge list')
with driver.session() as session, open("graph/movies.edgelist", "w") as edges_file:
result = session.run("""\
MATCH (m:MovieId)--(other)
RETURN id(m) AS source, id(other) AS target
""")
writer = csv.writer(edges_file, delimiter=" ")
for row in result:
writer.writerow([row["source"], row["target"]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment