163 lines
3.6 KiB
Markdown
163 lines
3.6 KiB
Markdown
# VI_Lab_01_EDA
|
||
|
||
## Datasaurus dozen
|
||
https://cran.r-project.org/web/packages/datasauRus/index.html
|
||
|
||
|
||
|
||
|
||
|
||
|
||
pip install ipykernel
|
||
|
||
***
|
||
|
||
Below is a clean, ready‑to‑ship **README.md** you can drop directly into your ZIP bundle.
|
||
It explains **exactly how students should prepare their environment in VS Code**, including:
|
||
|
||
* Installing Python
|
||
* Creating a **virtual environment**
|
||
* Installing required packages
|
||
* Setting up the **Jupyter kernel** to use that venv
|
||
* Opening and running the notebooks in VS Code
|
||
|
||
It uses **current and correct instructions** based on official VS Code documentation (Python + Jupyter extensions and venv usage) (installation workflow and environment activation practices align with Python & VS Code official practices, which are stable across versions).
|
||
|
||
If you want, I can also generate a **requirements.txt**, **environment.yml**, or a **bootstrap script**.
|
||
|
||
***
|
||
|
||
# 📘 README — Preparing Your Environment for Jupyter in VS Code
|
||
|
||
## (Virtual Environment + Kernel Setup)
|
||
|
||
This guide explains exactly how to prepare your system to run the EDA lab notebooks in **VS Code** using a clean Python **virtual environment**.
|
||
|
||
The steps work on **Windows, macOS, and Linux**.
|
||
|
||
***
|
||
|
||
# 1. Install the Required Tools
|
||
|
||
### 1.1 Install Python (3.9+ recommended)
|
||
|
||
Download from the official Python site (*python.org*) or using Microsoft Store.
|
||
|
||
Make sure to check:
|
||
|
||
* **Windows** → Add Python to PATH if installed from official site
|
||
* **macOS/Linux** → Python is usually included, but upgrade if needed
|
||
|
||
### 1.2 Install VS Code
|
||
|
||
Install from the official VS Code site.
|
||
|
||
### 1.3 Install VS Code Extensions
|
||
|
||
Open VS Code → **Extensions Panel** → install:
|
||
|
||
* **Python**
|
||
* **Jupyter**
|
||
|
||
These two extensions enable:
|
||
|
||
* Notebook execution
|
||
* Kernel selection
|
||
* Virtual environment detection
|
||
* Interactive cells
|
||
|
||
***
|
||
|
||
# 2. Create a Virtual Environment
|
||
|
||
Choose a folder where you will store your lab materials.
|
||
Open a terminal *inside that folder*:
|
||
|
||
### **Windows (PowerShell)**
|
||
|
||
```powershell
|
||
python -m venv venv
|
||
.\venv\Scripts\activate
|
||
```
|
||
|
||
### **macOS / Linux**
|
||
|
||
```bash
|
||
python3 -m venv venv
|
||
source venv/bin/activate
|
||
```
|
||
|
||
You should now see `(venv)` at the start of your terminal prompt.
|
||
|
||
***
|
||
|
||
# 3. Install Required Python Packages
|
||
|
||
Inside the active virtual environment, run:
|
||
|
||
```bash
|
||
pip install numpy pandas matplotlib sweetviz dtale jupyter
|
||
```
|
||
|
||
If you are using the Task 0 datasets, also install:
|
||
|
||
```bash
|
||
pip install seaborn
|
||
```
|
||
|
||
> 💡 **Tip:**
|
||
> If you have a `requirements.txt` in the bundle, run:
|
||
>
|
||
> ```bash
|
||
> pip install -r requirements.txt
|
||
> ```
|
||
|
||
***
|
||
|
||
# 4. Register the Virtual Environment as a Jupyter Kernel
|
||
|
||
VS Code can automatically detect your venv, but we ensure explicit registration:
|
||
|
||
```bash
|
||
python -m ipykernel install --user --name eda-env --display-name "EDA Lab Environment"
|
||
```
|
||
|
||
You will now see **EDA Lab Environment** as a selectable kernel inside VS Code notebooks.
|
||
|
||
***
|
||
|
||
# 5. ✅ Open the Lab in VS Code
|
||
|
||
1. Launch **VS Code**
|
||
2. Use **File → Open Folder** and choose the folder containing the lab files
|
||
3. Open any `.ipynb` file (e.g., `EDA_Lab_Starter.ipynb`)
|
||
4. At the top‑right corner of the notebook, click the **kernel selector**
|
||
5. Choose:
|
||
**EDA Lab Environment (Python venv)**
|
||
|
||
This ensures the notebook runs using the correct interpreter.
|
||
|
||
***
|
||
|
||
# 6. 🔍 (Optional) Verify Your Setup
|
||
|
||
In a notebook cell, run:
|
||
|
||
```python
|
||
import sys
|
||
sys.executable
|
||
```
|
||
|
||
It should show the Python path inside your `venv`, e.g.:
|
||
|
||
* Windows: `…/venv/Scripts/python.exe`
|
||
* macOS/Linux: `…/venv/bin/python`
|
||
|
||
Then check that the packages are available:
|
||
|
||
```python
|
||
import pandas, sweetviz, dtale
|
||
print("Environment OK")
|
||
```
|
||
|