Skip to content

Commit 6c5c2b5

Browse files
committed
provide setup instructions
1 parent 693d7f2 commit 6c5c2b5

File tree

4 files changed

+50
-25
lines changed

4 files changed

+50
-25
lines changed

README.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#### CAMBAM-CRM workshop, McGill University
2-
# Interactive data visualisation in Python :snake:
1+
# Workshop: Interactive data visualisation in Python :snake:
32

43
## Instructor
54
Dr. Thomas Bury <br>
@@ -10,25 +9,44 @@ Contact: thomas.bury@mcgill.ca
109
## Summary
1110
Modern scientific methods give rise to vast quantities of data. Creating effective visualisations is essential for both presentation and exploration of the data. This is no easy task when the data contains dozens of variables and millions of entries. Traditional visualisations are static, that is, what the user sees is what the user gets. Interactive visualisations allow the user to perform tasks such as varying parameters, honing in subsections of the data, and switching between different plot types, all without touching the code! This faciliates rapid exploration of the data. Moreover, these visulisations can be easily shared with collaborators who only require a web browser to open the visualisation.
1211

13-
This workshop will equip participants with the skills required to begin creating interactive visualisations in Python. The format will be interactive, with alternation between demonstrations by the instructor and participants working through their own Jupyter notebook (provided in advance). Participants will come away having made several of their own visualisations of either a large public dataset, or their own dataset if they would like to bring one. See this [interactive visualisation](https://ecg-dashboard-medium.herokuapp.com/) of ECG data from Physionet for an example of what can be achieved with these tools.
12+
This workshop will equip participants with the skills required to begin creating interactive visualisations in Python, using the [Plotly](https://plotly.com/python/) library. The format will be interactive, with alternation between demonstrations by the instructor and participants working through their own Jupyter notebook (provided in advance). Participants will come away having made several of their own visualisations of either a large public dataset, or their own dataset if they would like to bring one. Check out this [interactive visualisation](https://ecg-dashboard-medium.herokuapp.com/) of ECG data from Physionet for an example of what can be achieved with these tools.
1413

1514
## Objectives
16-
In this workshop, we will use the *pandas* library to manipulate dataframes, the *plotly* library to make interactive visualisations and the *dash* library to bring together the visualisations into a dashboard. Participants of the workshop will learn and implement the following techniques:
15+
We will cover the following:
1716
- Organisation of *pandas* DataFrames to facilitate rapid plotting.
18-
- Use of basic Plotly functionality including the creation of different plot representations (Bar, Line, Scatter, Histogram) and exportation to html files for interactive viewing.
19-
- Visualisation of higher-dimensional data with the use of multiple traces, grid plots and 3-dimensional plotting.
20-
- Integration of sliders and drop-down boxes to interactively switch between different visualisations of the data.
21-
- (If time allows.) Combining interactive plots into a dashboard with components connected by callback functions.
22-
17+
- Creating basic interactive plots in *Plotly* (Bar, Line, Scatter, Histogram).
18+
- Visualisation of multiple dimensions using multiple traces, grid plots and 3-dimensional graphs.
19+
- Integration of sliders and drop-down boxes.
20+
- (If time allows.) Combining interactive plots into a dashboard.
2321

2422
## Setup instructions
2523

26-
Python 3 and JupyterLab are required for the workshop. If these are already installed on your computer you may skip these steps.
27-
1. Download the Anaconda distribution
28-
2.
24+
1. Install the Anaconda distribution available [here](https://www.anaconda.com/products/distribution). This comes with Python 3, JupyterLab and a large number of Python packages.
25+
26+
2. Install Python packages for *plotly* and *dash* by entering the following commands into your Terminal (Mac) or Command Prompt (PC):
27+
28+
```bash
29+
conda install plotly
30+
conda install dash
31+
conda install -c conda-forge -c plotly jupyter-dash
32+
33+
3. Install [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) if not already on your computer.
34+
35+
4. Make a [Github](https://github.com/) account if you don't already have one.
36+
37+
5. Go to the workshop [repository](https://github.com/ThomasMBury/workshop_datavis_python), and create a *fork* (button on top right). This creates your own version of the repository, allowing you to make edits to the workshop notebooks.
38+
39+
6. *Clone* your repository to your computer. To do this, click the green button that says 'Code', and copy the link that appears in the box. Then go to your Terminal (or Command Prompt), navigate to a folder where you would like to store the repository and enter
40+
41+
```
42+
git clone paste-your-link-here
43+
```
44+
45+
You should now see the directory *workshop_datavis_python* saved on your computer.
46+
47+
7. Open the Anaconda Navigator and launch JupyterLab. Navigate to where you saved the workshop repository and open *test.ipynb*. You should be able to run this notebook without any errrors.
2948
30-
....finish this.....
49+
If you run into issues, please contact me at thomas.bury@mcgil.ca.
3150
32-
If you run into issues, please contact the instructor for help.
3351
3452

installation_instructions.pdf

-47.2 KB
Binary file not shown.

slides.pdf

-1.95 MB
Binary file not shown.

test.ipynb

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"Hello everyone! If you're reading this you've successfully booted up a Jupyter notebook. We will be using Jupyter notebooks throughout the workshop so it's a good idea to familiarise yourself with them.\n",
14+
"Hello everyone! If you're reading this you've successfully launched a Jupyter notebook. We will be using Jupyter notebooks throughout the workshop so it's a good idea to familiarise yourself with them.\n",
1515
"\n",
1616
"Below we are going to import the required Python libraries to check that they were installed successfully on your computer. Click the cell below and run it using either the 'play button' above or by pressing shift + enter."
1717
]
1818
},
1919
{
2020
"cell_type": "code",
21-
"execution_count": 1,
21+
"execution_count": 2,
2222
"metadata": {},
2323
"outputs": [],
2424
"source": [
@@ -29,8 +29,8 @@
2929
"import plotly.graph_objects as go\n",
3030
"import dash\n",
3131
"from jupyter_dash import JupyterDash\n",
32-
"import dash_core_components as dcc\n",
33-
"import dash_html_components as html\n",
32+
"from dash import dcc\n",
33+
"from dash import html\n",
3434
"from dash.dependencies import Input, Output"
3535
]
3636
},
@@ -45,7 +45,7 @@
4545
},
4646
{
4747
"cell_type": "code",
48-
"execution_count": 2,
48+
"execution_count": 3,
4949
"metadata": {},
5050
"outputs": [],
5151
"source": [
@@ -55,7 +55,7 @@
5555
},
5656
{
5757
"cell_type": "code",
58-
"execution_count": 3,
58+
"execution_count": 4,
5959
"metadata": {},
6060
"outputs": [
6161
{
@@ -165,7 +165,7 @@
165165
"59 32 "
166166
]
167167
},
168-
"execution_count": 3,
168+
"execution_count": 4,
169169
"metadata": {},
170170
"output_type": "execute_result"
171171
}
@@ -176,7 +176,7 @@
176176
},
177177
{
178178
"cell_type": "code",
179-
"execution_count": 4,
179+
"execution_count": 5,
180180
"metadata": {},
181181
"outputs": [],
182182
"source": [
@@ -186,7 +186,7 @@
186186
},
187187
{
188188
"cell_type": "code",
189-
"execution_count": 5,
189+
"execution_count": 6,
190190
"metadata": {},
191191
"outputs": [],
192192
"source": [
@@ -199,11 +199,18 @@
199199
"source": [
200200
"After running the above cells, you should find a file named my_first_fig.html. Go ahead and open it, either in JupyterLab (click 'trust HTML') or in your web browser . You should see your first Plotly visualisation of the Gapminder dataset. Congrats and see you in the workshop!"
201201
]
202+
},
203+
{
204+
"cell_type": "code",
205+
"execution_count": null,
206+
"metadata": {},
207+
"outputs": [],
208+
"source": []
202209
}
203210
],
204211
"metadata": {
205212
"kernelspec": {
206-
"display_name": "Python 3",
213+
"display_name": "Python 3 (ipykernel)",
207214
"language": "python",
208215
"name": "python3"
209216
},
@@ -217,7 +224,7 @@
217224
"name": "python",
218225
"nbconvert_exporter": "python",
219226
"pygments_lexer": "ipython3",
220-
"version": "3.7.6"
227+
"version": "3.7.13"
221228
}
222229
},
223230
"nbformat": 4,

0 commit comments

Comments
 (0)