There are multiple python driver ,which can be used to work on neo4j with python.
One of them is py2neo.
simply google py2neo and you will get the detailed documentation for the same
One of the alternative is install neo4j driver and after that create connection with neo4j and give query which you want to execute in transaction.
in the data science question you must open the sand box for neo4j , run the server and copy the connection credentials which will be given in the snapshot code you have provided