Skip to content

Instantly share code, notes, and snippets.

@cj2001
Created February 9, 2021 23:56
Show Gist options
  • Save cj2001/ffaff0ceb514f6863c69941239511449 to your computer and use it in GitHub Desktop.
Save cj2001/ffaff0ceb514f6863c69941239511449 to your computer and use it in GitHub Desktop.
Query arXiv data in Neo4j
query_string = '''
MATCH (c:Category)
RETURN c.category_name, SIZE(()-[:IN_CATEGORY]->(c)) AS inDegree
ORDER BY inDegree DESC LIMIT 20
'''
top_cat_df = pd.DataFrame([dict(_) for _ in conn.query(query_string)])
top_cat_df.head(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment