I’ll need to interact with the Neo 4J database using the Python driver.
The package that I used was the neo4J
library.
Install that and import the graph database driver.
from neo4j import GraphDatabase
CALL gds.graph.project.cypher( | |
'projection_trains', | |
'MATCH (s:Stop) RETURN id(s) AS id', | |
'MATCH (s:Stop)-[:NEXT_STOP]->(t:Stop) RETURN id(s) AS source, id(t) AS target, "NEXT_STOP" AS type' | |
); | |
CALL gds.betweenness.write('projection_trains', { | |
writeProperty: 'betweennessCentrality' | |
}); |
import os | |
# Iterate through all .txt files in "data" folder | |
if not os.path.exists("output"): | |
os.makedirs("output") | |
station_list = set() | |
for file in os.listdir("data"): | |
if file.endswith(".txt"): | |
text = open("data/{}".format(file), "r").read().split("\n") |
// Basic import from a CSV file hosted online | |
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/efekarakus/potter-network/master/data/characters.csv' AS character | |
CREATE (c:Character { | |
id: character.id, | |
name: character.name, | |
bio: character.bio | |
}); | |
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/efekarakus/potter-network/master/data/relations.csv' AS relationship |
a | b | |
---|---|---|
98 | 43 | |
39 | 93 | |
28 | 99 | |
28 | 41 | |
74 | 51 | |
74 | 48 | |
18 | 30 | |
51 | 10 | |
51 | 44 |
# ============================================================================== | |
# Title: Taxi-V3 OpenAI Gym Environment Update | |
# Author: Taresin | |
# Date: 26/02/2024 | |
# | |
# Description: This code is an update to a previously existing Gist for OpenAI Gym | |
# environments. It incorporates fixes the functionality | |
# with compatibility to the new Gymnasium library. The update is based on the original work found in Aske Plaat's | |
# book "Deep Reinforcement Learning" and the original code by Geffy available at | |
# https://gist.github.com/geffy/b2d16d01cbca1ae9e13f11f678fa96fd |
#!/usr/bin/env bash | |
# Creates a file called test.txt | |
FILE_NAME="chmod_game.txt" | |
get_random() { | |
shuf -i 0-$1 -n 1 | |
} | |
owner=$(get_random 7) |
I hereby claim:
To claim this, I am signing this object:
Question 1 | |
----------- | |
Test Case 1 | |
Input: Freddy | |
Non-numerical input occurred | |
Answer: -1 | |
Test Case 2 | |
Input: 40Freddy | |
Non-numerical input occurred |
Left Aligned | |
* | |
** | |
*** | |
**** | |
***** | |
****** | |
******* | |
******** | |
********* |