Loading read_graph.py 0 → 100644 +22 −0 Original line number Diff line number Diff line import Atlas import helper_functions as hf import json import matplotlib.pyplot as plt import pandas as pd pctDataF = open("pct21_20cen_wMCD.json") pctData = json.load(pctDataF) import networkx as nx g = nx.Graph() # g.add_edge(1, 2) for (ii, adj_data) in enumerate(pctData["adjacency"]): for adj in adj_data: jj = adj["id"] g.add_edge(ii, jj) inc_node_data = ['pop2020cen', 'G08_PR_D', 'G08_PR_R'] for (ii, _) in enumerate(pctData['nodes']): for d in inc_node_data: g.nodes[ii][d] = pctData["nodes"][ii][d] print(g.nodes[0]) No newline at end of file Loading
read_graph.py 0 → 100644 +22 −0 Original line number Diff line number Diff line import Atlas import helper_functions as hf import json import matplotlib.pyplot as plt import pandas as pd pctDataF = open("pct21_20cen_wMCD.json") pctData = json.load(pctDataF) import networkx as nx g = nx.Graph() # g.add_edge(1, 2) for (ii, adj_data) in enumerate(pctData["adjacency"]): for adj in adj_data: jj = adj["id"] g.add_edge(ii, jj) inc_node_data = ['pop2020cen', 'G08_PR_D', 'G08_PR_R'] for (ii, _) in enumerate(pctData['nodes']): for d in inc_node_data: g.nodes[ii][d] = pctData["nodes"][ii][d] print(g.nodes[0]) No newline at end of file