-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lutz Hamel
committed
Jan 15, 2025
1 parent
557b57f
commit 2ce17de
Showing
2 changed files
with
344 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# VSCode/Jupyter Installation Instructions | ||
|
||
The following instructions should work on all systems | ||
for which VSCode is available. We have tested these instructions | ||
on macOS and Windows. | ||
|
||
* Install Microsoft [Visual Studio Code](https://code.visualstudio.com/) (VSCode) | ||
* Ensure that you have a **working installation of Python 3.x**. | ||
By working we mean that you can invoke Python from | ||
the commandline with the 'python' or 'python3' command. | ||
If this does not work then reinstall [Python](https://www.python.org/) making sure that you allow the installation to modify | ||
your 'path' environment variable. | ||
* Ensure that you have a **working version of git**. Same criteria | ||
as above. If not then | ||
install it from [here](https://git-scm.com/) | ||
* Start VSCode and load the 'install.ipynb' notebook available | ||
in the folder where this readme resides | ||
* Follow the instructions in the notebook | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,325 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Installation Notebook for VSCode\n", | ||
"\n", | ||
"## Installing the Jupyter extension\n", | ||
"\n", | ||
"* Load this notebook into your VSCode editor\n", | ||
"\n", | ||
"* Install the 'Jupyter' extension published by Microsoft. Usuall\n", | ||
" this means simply following the instructions given by VSCode.\n", | ||
"\n", | ||
"* Press the 'Select Kernel' button and keep selecting Python Environment/Python until you have selected a specific Python version (if no specific Python version shows up then you do not have a working Python installation on your machine - see README)\n", | ||
"\n", | ||
"* Once you have a Python kernel selected press the 'Run All' \n", | ||
" button. Your notebook should run and the last code cell \n", | ||
" should print out the message \"*** installation is working ***\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Notebook Autoconfig\n", | ||
"\n", | ||
"The following code cell configures your notebook according to \n", | ||
"the requirements of the CSC310 course." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Already up to date.\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import sys, os, platform\n", | ||
"if os.path.isdir(\"ds-assets\"):\n", | ||
" !cd ds-assets && git pull\n", | ||
"else:\n", | ||
" !git clone https://github.com/lutzhamel/ds-assets.git\n", | ||
"colab = True if 'google.colab' in os.sys.modules else False\n", | ||
"system = platform.system() # \"Windows\", \"Linux\", \"Darwin\"\n", | ||
"if system not in [\"Windows\", \"Linux\", \"Darwin\"]:\n", | ||
" raise Exception(\"System not supported: \"+system)\n", | ||
"home = \"ds-assets/assets/\"\n", | ||
"sys.path.append(home) " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Install required Modules\n", | ||
"\n", | ||
"The following code cell will install required modules on \n", | ||
"your machine." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Requirement already satisfied: pandas in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (2.2.3)\n", | ||
"Requirement already satisfied: numpy>=1.26.0 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from pandas) (2.2.0)\n", | ||
"Requirement already satisfied: python-dateutil>=2.8.2 in /Users/lutz/Library/Python/3.13/lib/python/site-packages (from pandas) (2.9.0.post0)\n", | ||
"Requirement already satisfied: pytz>=2020.1 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from pandas) (2024.2)\n", | ||
"Requirement already satisfied: tzdata>=2022.7 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from pandas) (2024.2)\n", | ||
"Requirement already satisfied: six>=1.5 in /Users/lutz/Library/Python/3.13/lib/python/site-packages (from python-dateutil>=2.8.2->pandas) (1.17.0)\n", | ||
"Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (2.2.0)\n", | ||
"Requirement already satisfied: scikit-learn in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (1.6.0)\n", | ||
"Requirement already satisfied: numpy>=1.19.5 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from scikit-learn) (2.2.0)\n", | ||
"Requirement already satisfied: scipy>=1.6.0 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from scikit-learn) (1.14.1)\n", | ||
"Requirement already satisfied: joblib>=1.2.0 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from scikit-learn) (1.4.2)\n", | ||
"Requirement already satisfied: threadpoolctl>=3.1.0 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from scikit-learn) (3.5.0)\n", | ||
"Requirement already satisfied: matplotlib in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (3.10.0)\n", | ||
"Requirement already satisfied: contourpy>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib) (1.3.1)\n", | ||
"Requirement already satisfied: cycler>=0.10 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib) (0.12.1)\n", | ||
"Requirement already satisfied: fonttools>=4.22.0 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib) (4.55.3)\n", | ||
"Requirement already satisfied: kiwisolver>=1.3.1 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib) (1.4.7)\n", | ||
"Requirement already satisfied: numpy>=1.23 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib) (2.2.0)\n", | ||
"Requirement already satisfied: packaging>=20.0 in /Users/lutz/Library/Python/3.13/lib/python/site-packages (from matplotlib) (24.2)\n", | ||
"Requirement already satisfied: pillow>=8 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib) (11.0.0)\n", | ||
"Requirement already satisfied: pyparsing>=2.3.1 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib) (3.2.0)\n", | ||
"Requirement already satisfied: python-dateutil>=2.7 in /Users/lutz/Library/Python/3.13/lib/python/site-packages (from matplotlib) (2.9.0.post0)\n", | ||
"Requirement already satisfied: six>=1.5 in /Users/lutz/Library/Python/3.13/lib/python/site-packages (from python-dateutil>=2.7->matplotlib) (1.17.0)\n", | ||
"Requirement already satisfied: seaborn in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (0.13.2)\n", | ||
"Requirement already satisfied: numpy!=1.24.0,>=1.20 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from seaborn) (2.2.0)\n", | ||
"Requirement already satisfied: pandas>=1.2 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from seaborn) (2.2.3)\n", | ||
"Requirement already satisfied: matplotlib!=3.6.1,>=3.4 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from seaborn) (3.10.0)\n", | ||
"Requirement already satisfied: contourpy>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (1.3.1)\n", | ||
"Requirement already satisfied: cycler>=0.10 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (0.12.1)\n", | ||
"Requirement already satisfied: fonttools>=4.22.0 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (4.55.3)\n", | ||
"Requirement already satisfied: kiwisolver>=1.3.1 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (1.4.7)\n", | ||
"Requirement already satisfied: packaging>=20.0 in /Users/lutz/Library/Python/3.13/lib/python/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (24.2)\n", | ||
"Requirement already satisfied: pillow>=8 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (11.0.0)\n", | ||
"Requirement already satisfied: pyparsing>=2.3.1 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (3.2.0)\n", | ||
"Requirement already satisfied: python-dateutil>=2.7 in /Users/lutz/Library/Python/3.13/lib/python/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (2.9.0.post0)\n", | ||
"Requirement already satisfied: pytz>=2020.1 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from pandas>=1.2->seaborn) (2024.2)\n", | ||
"Requirement already satisfied: tzdata>=2022.7 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from pandas>=1.2->seaborn) (2024.2)\n", | ||
"Requirement already satisfied: six>=1.5 in /Users/lutz/Library/Python/3.13/lib/python/site-packages (from python-dateutil>=2.7->matplotlib!=3.6.1,>=3.4->seaborn) (1.17.0)\n", | ||
"Requirement already satisfied: PyMySQL in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (1.1.1)\n", | ||
"Requirement already satisfied: nltk in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (3.9.1)\n", | ||
"Requirement already satisfied: click in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from nltk) (8.1.8)\n", | ||
"Requirement already satisfied: joblib in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from nltk) (1.4.2)\n", | ||
"Requirement already satisfied: regex>=2021.8.3 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from nltk) (2024.11.6)\n", | ||
"Requirement already satisfied: tqdm in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from nltk) (4.67.1)\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"!pip3 install pandas\n", | ||
"!pip3 install numpy\n", | ||
"!pip3 install scikit-learn # sklearn\n", | ||
"!pip3 install matplotlib\n", | ||
"!pip3 install seaborn\n", | ||
"!pip3 install PyMySQL\n", | ||
"!pip3 install nltk\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Basic Testing\n", | ||
"\n", | ||
"Run some basic data science tasks to see if your notebook works." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# notebook level imports\n", | ||
"import pandas # general data tool box" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"iris_df = pandas.read_csv(home+'iris.csv')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<div>\n", | ||
"<style scoped>\n", | ||
" .dataframe tbody tr th:only-of-type {\n", | ||
" vertical-align: middle;\n", | ||
" }\n", | ||
"\n", | ||
" .dataframe tbody tr th {\n", | ||
" vertical-align: top;\n", | ||
" }\n", | ||
"\n", | ||
" .dataframe thead th {\n", | ||
" text-align: right;\n", | ||
" }\n", | ||
"</style>\n", | ||
"<table border=\"1\" class=\"dataframe\">\n", | ||
" <thead>\n", | ||
" <tr style=\"text-align: right;\">\n", | ||
" <th></th>\n", | ||
" <th>id</th>\n", | ||
" <th>Sepal.Length</th>\n", | ||
" <th>Sepal.Width</th>\n", | ||
" <th>Petal.Length</th>\n", | ||
" <th>Petal.Width</th>\n", | ||
" <th>Species</th>\n", | ||
" </tr>\n", | ||
" </thead>\n", | ||
" <tbody>\n", | ||
" <tr>\n", | ||
" <th>0</th>\n", | ||
" <td>1</td>\n", | ||
" <td>5.1</td>\n", | ||
" <td>3.5</td>\n", | ||
" <td>1.4</td>\n", | ||
" <td>0.2</td>\n", | ||
" <td>setosa</td>\n", | ||
" </tr>\n", | ||
" <tr>\n", | ||
" <th>1</th>\n", | ||
" <td>2</td>\n", | ||
" <td>4.9</td>\n", | ||
" <td>3.0</td>\n", | ||
" <td>1.4</td>\n", | ||
" <td>0.2</td>\n", | ||
" <td>setosa</td>\n", | ||
" </tr>\n", | ||
" <tr>\n", | ||
" <th>2</th>\n", | ||
" <td>3</td>\n", | ||
" <td>4.7</td>\n", | ||
" <td>3.2</td>\n", | ||
" <td>1.3</td>\n", | ||
" <td>0.2</td>\n", | ||
" <td>setosa</td>\n", | ||
" </tr>\n", | ||
" <tr>\n", | ||
" <th>3</th>\n", | ||
" <td>4</td>\n", | ||
" <td>4.6</td>\n", | ||
" <td>3.1</td>\n", | ||
" <td>1.5</td>\n", | ||
" <td>0.2</td>\n", | ||
" <td>setosa</td>\n", | ||
" </tr>\n", | ||
" <tr>\n", | ||
" <th>4</th>\n", | ||
" <td>5</td>\n", | ||
" <td>5.0</td>\n", | ||
" <td>3.6</td>\n", | ||
" <td>1.4</td>\n", | ||
" <td>0.2</td>\n", | ||
" <td>setosa</td>\n", | ||
" </tr>\n", | ||
" </tbody>\n", | ||
"</table>\n", | ||
"</div>" | ||
], | ||
"text/plain": [ | ||
" id Sepal.Length Sepal.Width Petal.Length Petal.Width Species\n", | ||
"0 1 5.1 3.5 1.4 0.2 setosa\n", | ||
"1 2 4.9 3.0 1.4 0.2 setosa\n", | ||
"2 3 4.7 3.2 1.3 0.2 setosa\n", | ||
"3 4 4.6 3.1 1.5 0.2 setosa\n", | ||
"4 5 5.0 3.6 1.4 0.2 setosa" | ||
] | ||
}, | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"iris_df.head(n=5)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"(150, 6)" | ||
] | ||
}, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"iris_df.shape" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"*** installation is working ***\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(\"*** installation is working ***\")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.13.1" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |