Materials for the NumPy Tutorial at SciPy 2024
- The easiest way to get the materials is to clone this repository (SSH, HTTPS, or GitHub CLI should all work) using commands in the green "Code" button above. For example, using the SSH method, type:
git clone git@github.com:DillerDigital/2024SciPyTutorial.git
- You can also download the zipped folder directly using GitHub's download features.
- Open a terminal session and navigate to the tutorial folder.
I strongly recommend that you work in a dedicated environment for this tutorial (and for each project you work on). For a host of reasons, it's better not to modify your base (or system) Python by installing packages globally, and it's better not to do all of your work in the same Python environment. Here is one nicely articulated explanation. The internet has many more.
There are at least three good methods of using Python environments. It doesn't matter so much which one you select; they each have their strengths and weaknesses. The biggest advantage will be with the one you're already familiar with.
- If you don't have Python on your system, download version 3.11 and install it now. (Some data science libraries are still working on complete compatibility with 3.12, but that is coming soon.)
- In your tutorials folder, type the following to create a
venvand usepipto install the necessary dependencies. Note: depending on your system, you may need to typepython3instead ofpythonfor the first line below to work:
- In a terminal, type:
$ python -m venv numpy_tutorial_venv
$ source numpy_tutorial_venv/bin/activate
(numpy_tutorial_venv) $ pip install jupyterlab numpy matplotlib
- In a PowerShell terminal, type:
C:\Users\you\Tutorial> python -m venv numpy_tutorial_venv
C:\Users\you\Tutorial> numpy_tutorial_venv\Scripts\Activate.ps1
(scipy_2024_tutorial)C:\Users\you\Tutorial> pip install jupyterlab numpy matplotlib
- The Enthought Deployment Manager
edmwill install Python executables and well-tested packages. Currently delivering Python 3.8 and soon to deliver 3.11, the focus of packages delivered byedmis stability, thorough testing, and seamless interoperability. There is is no need to install Python separately, asedmwill install runtime executables. - Download and install Enthought's EDM.
$ edm envs create numpy_tutorial
$ edm shell -e numpy_tutorial
(numpy_tutorial) $ edm install jupyterlab numpy matplotlib
- Download the
condainstaller from Anaconda.condais a popular and widely-used distribution of Python and packages suitable for scientific computing.
$ conda create -n numpy_tutorial_venv jupyterlab numpy matplotlib
$ conda activate numpy_tutorial_venv
- From your terminal, change to the directory you cloned or the direcotry where you downloaded the notebook and data directory.
- Type the following to launch Jupyer Lab:
(numpy_tutorial_venv) $ jupyter lab
- Click the folder icon at the left edge of the browser window.
- Double-click the file
scipy_2024_numpy_tutorial.ipynb. - Appearance of the tutorial notebook indicates a successful installation.