Skip to content

Commit

Permalink
update chap 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziaeemehr committed Aug 22, 2024
1 parent a9a6549 commit 89205ab
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions docs/examples/chap_02.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -640,6 +640,8 @@
"# Create the 'network_science' directory in MyDrive if it doesn't exist\n",
"network_science_dir = '/content/drive/MyDrive/network_science'\n",
"os.makedirs(network_science_dir, exist_ok=True)\n",
"# empty the directory\n",
"!rm -rf /content/drive/MyDrive/network_science/*\n",
"# Change directory to 'network_science'\n",
"os.chdir(network_science_dir)\n",
"# Download the zip file to the 'network_science' directory\n",
Expand All @@ -655,7 +657,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -668,7 +670,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 25,
"metadata": {},
"outputs": [
{
Expand All @@ -690,14 +692,14 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 26,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Processing sample graphs: 100%|██████████| 10/10 [00:00<00:00, 19463.13it/s]"
"Processing sample graphs: 100%|██████████| 10/10 [00:00<00:00, 79588.31it/s]"
]
},
{
Expand Down Expand Up @@ -731,14 +733,14 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Processing sample graphs: 100%|██████████| 9/9 [00:33<00:00, 3.72s/it]\n"
"Processing sample graphs: 100%|██████████| 9/9 [00:30<00:00, 3.42s/it]\n"
]
},
{
Expand Down Expand Up @@ -859,7 +861,7 @@
"8 325729 1497134 9.192513 True WWW"
]
},
"execution_count": 20,
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -868,7 +870,7 @@
"data_list = []\n",
"\n",
"for net in tqdm(nets[:-1], desc=\"Processing sample graphs\"):\n",
" G = load_sample_graph(net)\n",
" G = load_sample_graph(net) # on colab: add colab_path=network_science_dir\n",
" num_nodes = G.number_of_nodes()\n",
" num_edges = G.number_of_edges()\n",
" avg_degree = average_degree(G)\n",
Expand All @@ -889,6 +891,13 @@
"# Display the DataFrame\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 89205ab

Please sign in to comment.