This is a demo of getting started with Jupyter, and shows the culture of Python.
You can use Anaconda or Python to run Jupyter. Anaconda is great for the non-geeks. We'll use Python.
-
Create a virtual environment:
python -m venv .venv
Activate it:
Linux:
source .venv/bin/activate
Windows Powershell:
.venv/Scripts/activate
Windows Batch:
.venv/Scripts/activate.bat
-
Install Python libraries:
pip install -r requirements.txt
Pick one:
jupyter notebook
then open the browser as directed in the console output
OR
-
Install VS Code
-
Install the Python extension and/or the Jupyter extension. (The Python extension installs the Jupyter extension too)
-
Choose the Python environment:
a. cntrl-shift-P
b. type
Python: Select interpreter
c. choose the line with
.ven
in it
-
Open
1-fibonacci.ipynb
-
Run each cell by clicking the triangle to the left of each code block
The main libraries are:
- SqlAlchemy: SQL ORM (requires drivers)
- Pandas: data processing
-
Start the databases
docker-compose up
This will launch SQL Server and Postgres and load up data into SQL Server
-
Open
2-etl.ipynb
-
Run each cell by clicking the triangle to the left of each code block
-
Open
3-runbook.ipynb
-
Run each cell by clicking the triangle to the left of each code block
The main libraries here are:
- NumPy: scientific math
- Pandas: data processing, data frames
- MatPlotLib: graphing library
-
Open
4-graphing.ipynb
-
Run each cell by clicking the triangle to the left of each code block
-
Start the databases if they're not running already
docker-compose up
-
Open
5-graph-from-db.ipynb
-
Run each cell by clicking the triangle to the left of each code block
-
Open VS Code
-
Right-click on a notebook and choose
Import notebook to script
-
Save as, renaming to
myapp.py
-
Run the program:
python myapp.py
-
Run the api:
uvicorn 6-api:app --reload
-
Play with each endpoint
MIT