cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Can a neo4j graph projected in Python be then transformed to pandas dataframe/tensor/numpy/etc to be used with pytorch/etc.?

I'm trying to run algorithms on Neo4j's Aura DS databases.

It seems like I've by and large understood how to connect to an Aura DS database, project a particular graph, then apply one of the algorithms from the graphdatascience (GDS) library in order to do node classification or solve some other machine learning problem.

However, can I somehow connect to an Aura DS database and retrieve the data in a format like pandas dataframe/tensor/numpy array/etc. and use other libraries besides GDS to train?

Apologies if this is trivial. I've tried searching for this, but got no satisfactory answer.

3 REPLIES 3

@doris.voina Hello!
If you using py2neo for connection to DB, you can try this py2neo export.

You can use:

* `pd.DataFrame(result.data()) 

* in the current release the python driver also has a result.to_df()

* the graph data science client returns dataframes for gds.run_cypher(query)

see our answer here in the Aura office hours

https://youtu.be/-PcjPtKgYsI?t=1686

New to Neo4j AuraDB? Ask your questions to David Allen so you can be more successful with Neo4j! 0:00 Welcome 2:45 Q1: ODBC Connection Issues 9:25 Q2: Delete Database 18:33 Q3: Reset Password 22:42 Q1+: ODBC Connection encore 28:05 Q4: Pandas Dataframes 36:00 Wrap-Up Links: Q1: ...

Any tips on the I think the reverse? I've got a large (2 million x 2 million) sparse matrix (from scipy) that I would like to load into neo4j.