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.

Cypher result to pandas dataframe issue

Hi Team,
I was doing some hands-on with Neo4j + Cypher + Python, and was trying to convert the result into Pandas DataFrame, but getting below error.

Code used :

results = %cypher http://XXX:XXXX@localhost:7474/db/data MATCH (person:Person)-[:LIKES]->(drink:Drink) \
                  RETURN person.name AS name, drink.name AS drink
    
df = results.get_dataframe()

Error : ImportError: Try installing Pandas first.
I have install the Pandas and able to use the pandas using import statement and was also able to perform other operations on pandas, but somehow when using the method get_dataframe(), it is failing.
Help help in identifying the issue, or suggest.

1 REPLY 1

poonsfci
Node Link

Hi, are you using jupyter notebook? Do you have a 'import pandas as pd' in your notebook?
can you print the results before get_dataframe to ensure %cypher magic working first? "print('results=>',results)". Perhaps, it might help you to understand what is happening.