|
1 | 1 | --- |
2 | | -title: Setup |
| 2 | +title: "Setup" |
3 | 3 | --- |
4 | 4 |
|
5 | | -FIXME: Setup instructions live in this document. Please specify the tools and |
6 | | -the data sets the Learner needs to have installed. |
| 5 | +## Overview |
7 | 6 |
|
8 | | -## Data Sets |
| 7 | +To participate in the **Data Visualization** module, you will need: |
9 | 8 |
|
10 | | -<!-- |
11 | | -FIXME: place any data you want learners to use in `episodes/data` and then use |
12 | | - a relative link ( [data zip file](data/lesson-data.zip) ) to provide a |
13 | | - link to it, replacing the example.com link. |
14 | | ---> |
15 | | -Download the [data zip file](https://example.com/FIXME) and unzip it to your Desktop |
| 9 | +- **Python 3.10 or newer** (3.11–3.12 recommended in local setups) |
| 10 | +- The following Python packages: |
| 11 | + - pandas (data handling) |
| 12 | + - matplotlib (core plotting) |
| 13 | + - seaborn (statistical visualizations) |
| 14 | + - (optional but recommended) jupyterlab or notebook (interactive work) |
| 15 | + - (optional) plotly (interactive charts in later episodes) |
| 16 | +- A code editor or notebook interface |
| 17 | +- Sample datasets (provided as a zip file) |
16 | 18 |
|
17 | | -## Software Setup |
| 19 | +We offer **two main setup paths**: |
18 | 20 |
|
19 | | -::::::::::::::::::::::::::::::::::::::: discussion |
| 21 | +1. **Google Colab** (recommended for beginners / no installation needed) |
| 22 | +2. **Local installation** with `Anaconda Navigator` (great for offline work and full control) |
20 | 23 |
|
21 | | -### Details |
| 24 | +## Option 1: Google Colab (Zero Installation – Recommended for Most Learners) |
22 | 25 |
|
23 | | -Setup for different systems can be presented in dropdown menus via a `spoiler` |
24 | | -tag. They will join to this discussion block, so you can give a general overview |
25 | | -of the software used in this lesson here and fill out the individual operating |
26 | | -systems (and potentially add more, e.g. online setup) in the solutions blocks. |
| 26 | +Google Colab is a free, cloud-based Jupyter notebook environment hosted by Google. It runs entirely in your browser, requires only a Google account, and comes with pandas, matplotlib, seaborn, and many other data science libraries **pre-installed**. |
27 | 27 |
|
28 | | -::::::::::::::::::::::::::::::::::::::::::::::::::: |
| 28 | +### Steps |
29 | 29 |
|
30 | | -:::::::::::::::: spoiler |
| 30 | +1. Go to → https://colab.research.google.com |
| 31 | +2. Sign in with your Google account (or create one if needed). |
| 32 | +3. Click **New notebook** (or File → New notebook). |
| 33 | +4. (Optional) Rename it: File → Rename (e.g., "Data Viz Workshop – Aniket"). |
| 34 | +5. Test the libraries right away by running this in the first cell (Shift+Enter to execute): |
31 | 35 |
|
32 | | -### Windows |
| 36 | + ```python |
| 37 | + import pandas as pd |
| 38 | + import matplotlib.pyplot as plt |
| 39 | + import seaborn as sns |
| 40 | + import plotly.express as px # optional – usually pre-installed too |
33 | 41 |
|
34 | | -Use PuTTY |
| 42 | + print("pandas version:", pd.__version__) |
| 43 | + print("matplotlib version:", plt.matplotlib.__version__) |
| 44 | + print("seaborn version:", sns.__version__) |
| 45 | + print("plotly version:", px.__version__ if 'px' in globals() else "not imported") |
35 | 46 |
|
36 | | -:::::::::::::::::::::::: |
| 47 | + # Quick test plot (should show inline) |
| 48 | + tips = sns.load_dataset("tips") # built-in Seaborn dataset |
| 49 | + sns.histplot(data=tips, x="total_bill", hue="time") |
| 50 | + plt.title("Test: Restaurant Tips Distribution") |
| 51 | + plt.show() |
| 52 | + ``` |
| 53 | +6. Installing extra packages (rarely needed, but if something is missing or outdated):Python |
37 | 54 |
|
38 | | -:::::::::::::::: spoiler |
| 55 | +```python |
| 56 | +!pip install --upgrade seaborn plotly |
| 57 | +``` |
39 | 58 |
|
40 | | -### MacOS |
| 59 | +(The `!` runs shell commands in Colab/Jupyter Notebook.) |
41 | 60 |
|
42 | | -Use Terminal.app |
| 61 | +## Advantages of Colab for this workshop |
43 | 62 |
|
44 | | -:::::::::::::::::::::::: |
| 63 | +- No software installation |
| 64 | +- Free GPU/TPU if needed later |
| 65 | +- Easy sharing (File → Share) |
| 66 | +- Autosaves to Google Drive |
| 67 | +- Perfect for following along with instructor demos |
45 | 68 |
|
| 69 | +**Tip**: Upload your own data files via the left sidebar (Files tab → Upload) or mount Google Drive: |
| 70 | +Python |
46 | 71 |
|
47 | | -:::::::::::::::: spoiler |
| 72 | +```python |
| 73 | +from google.colab import drive |
| 74 | +drive.mount('/content/drive') |
| 75 | +# Then read files like pd.read_csv('/content/drive/MyDrive/penguins.csv') |
| 76 | +``` |
48 | 77 |
|
49 | | -### Linux |
| 78 | +## Option 2: Local Installation (Anaconda Navigator – For Offline / Advanced Use) |
50 | 79 |
|
51 | | -Use Terminal |
| 80 | +Use this if you prefer working without internet or need a persistent environment. |
52 | 81 |
|
53 | | -:::::::::::::::::::::::: |
| 82 | +1. Download and install Anaconda Navigator: |
| 83 | + |
| 84 | +- https://www.anaconda.com/products/navigator |
| 85 | +- Choose your OS installer (Python 3.x version) → follow defaults |
| 86 | + |
| 87 | +2. You should find multiple apps after installation. |
| 88 | + |
| 89 | +- Launch `Jupyter Notebook` |
| 90 | +- If you do not find a package simply add `!pip` followed by the name of the package in code cell to install it locally. |
| 91 | + |
| 92 | +## Troubleshooting |
| 93 | + |
| 94 | +- **Colab:** Plots not showing? Add %matplotlib inline at the top (usually automatic). |
| 95 | +- **Local:** package not found: Open terminal or code cell in jupyter notebook and `!pip` install package. |
| 96 | +- **Need help?** Raise hand during workshop or check Carpentries Python setup guide. |
| 97 | + |
| 98 | +You're all set! Proceed to Introduction to Data Visualization or Creating Your First Plots. |
| 99 | + |
| 100 | +Happy visualizing! |
54 | 101 |
|
0 commit comments