Skip to content

Instantly share code, notes, and snippets.

@jeanmidevacc
Last active May 11, 2020 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeanmidevacc/efabbb8798abeffddfbd47df9316ba72 to your computer and use it in GitHub Desktop.
Save jeanmidevacc/efabbb8798abeffddfbd47df9316ba72 to your computer and use it in GitHub Desktop.
neo4j_evaluation_songs.py
query = """
MATCH (n:Song)
RETURN n.title AS title, size((n)<-[:BOOKMARKED]-()) AS count_bookmarked, size((n)<-[:REVIEWED]-()) AS count_reviewed, toInteger(n.upvotes) AS upvotes, toInteger(n.downvotes) AS downvotes, toInteger(n.upvotes) + toInteger(n.downvotes) AS votes
"""
with driver.session() as session:
result = session.run(query)
df_evaluation_songs = pd.DataFrame([r.values() for r in result], columns=result.keys())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment