<jupyter_start><jupyter_text>filter out motorway edges<jupyter_code>e = [(u, v, k) for u, v, k, d in G.edges(keys=True, data=True) if 'motorway' in d['highway']]
# remove motorway edges then retain only the largest strongly connected component
G.remove_edges_from(e)
G = ox.utils_graph.get_largest_component(G, strongly=True)
nodes, edges = ox.graph_to_gdfs(G)
edges['highway'].astype(str).value_counts()<jupyter_output><empty_output><jupyter_text>save graphs to disksave directed graph to disk<jupyter_code>ox.save_graphml(G, filepath='data/network/sf-directed-no-fwy.graphml')
nodes = ox.graph_to_gdfs(G, edges=False, node_geometry=False)
nodes.to_csv('data/network/sf-directed-no-fwy-nodelist.csv', index=True, encoding='utf-8')<jupyter_output><empty_output><jupyter_text>save undirected representation of graph to disk<jupyter_code>G_undir = ox.get_undirected(G)
ox.save_graphml(G_undir, filepath='data/network/sf-undirected-no-fwy.graphml')
nodes = ox.graph_to_gdfs(G_undir, edges=False, node_geometry=False)
nodes.to_csv('data/network/sf-undirected-no-fwy-nodelist.csv', index=True, encoding='utf-8')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13908450704225353, 'fraction_numerical': 0.0017605633802816902, 'mean_word_length': 8.635593220338983, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '468075', 'license': 'MIT', 'n_tokens_mistral': 441, 'n_tokens_neox': 428, 'n_words': 69, 'path': 'analysis/01-create-network-models.ipynb', 'repo_name': 'gboeing/two-way-conversions', 'size': '1136'}