Skip to content

Commit

Permalink
network statistics v1
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLeoni committed Oct 19, 2018
1 parent 18702e0 commit 937cbf9
Show file tree
Hide file tree
Showing 7 changed files with 1,548 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
"toc_window_display": true
}
},
"nbformat": 4,
Expand Down
10 changes: 10 additions & 0 deletions exercises/introduction/introduction-solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,16 @@
"- when something seem wrong in computations, try to clean memory by running `Kernel->Restart and Run all`\n",
"- when you see an asterisk to the side of a cell, maybe the computationg has hanged (an infinite while?). To solve the problem, run `Kernel->shutdown` and then `Kernel -> restart\n",
"\n",
"### Browsing notebooks\n",
"\n",
"(Optional) To improve your browsing experience, you might wish to install some Jupyter extension , like `toc2` which shows paragraphs on the sidebar. To install, see [instructions on Jupman page](https://jupman.readthedocs.io/en/latest/usage.html#Optional---Install-Jupyter-contrib-extensions)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Course exercise formats\n",
"\n",
"In this course, on the website you will find the solutions to the exercises. At the top page of each solution, you will find the link to download a zip. Each zip contains both the exercises to do as files to edit, along with their solution in a separate file.\n",
Expand Down
72 changes: 58 additions & 14 deletions exercises/matrix-networks/matrix-networks-solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,62 @@
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Required libraries\n",
"\n",
"In order for visualizations to work, you need installed the python library `networkx` and `pydot`. Pydot is an interface to the non-pyhon package [GraphViz](http://graphviz.org/).\n",
"\n",
"**Anaconda:**\n",
"\n",
"From Anaconda Prompt:\n",
"\n",
"1. Install GraphViz:\n",
"\n",
"```bash\n",
"conda install graphviz\n",
"```\n",
"\n",
"2. Install python packages:\n",
"\n",
"```bash\n",
"conda install pydot networkx\n",
"```\n",
"\n",
"\n",
"**Ubuntu**\n",
"\n",
"From console: \n",
"\n",
"1. Install PyGraphViz (note: you should use apt to install it, pip might give problems):\n",
"\n",
"```bash\n",
"sudo apt install python3-pygraphviz\n",
"```\n",
"\n",
"2. Install python packages:\n",
"\n",
"```bash\n",
"python3 -m pip install --user pydot networkx\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Visualization examples\n",
"\n",
"We defined a function `sciprog.draw_mat`to display matrices as graphs (you don't need to understand the internals, for now we won't go into depth about matrix visualizations)\n"
"We defined a function `sciprog.draw_mat`to display matrices as graphs (you don't need to understand the internals, for now we won't go into depth about matrix visualizations). \n",
"\n",
"If it doesn't work, see above [Required libraries paragraph](#Required-libraries)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -146,7 +190,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -177,7 +221,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -208,7 +252,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -243,7 +287,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -280,7 +324,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -318,7 +362,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -364,7 +408,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -427,7 +471,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -477,7 +521,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -537,7 +581,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -643,7 +687,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -681,7 +725,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit 937cbf9

Please sign in to comment.