Advanced Python Workshop – Fall 2024

Overview

This 2-day workshop will cover advanced Python coding topics and their application to data analysis. It is targeted to users with some basic knowledge of Python. Topics covered:

  1. Day 1: Introduction to classes; advanced function signatures; error handling.
  2. Day 2: Data analysis, including data visualization & manipulation, statistics, and curve fitting with SciPy & similar packages.

The format will be a mixture of lectures and labs. Each day will consist of a morning and afternoon session, each lasting approximately 2.5 hours (with breaks). See below for a more detailed schedule. The workshop will be in-person only. Workshop materials will be made available online afterward.

🗓ī¸ Dates

Day 1: Thursday December 12, 2024

Day 2: Friday December 13, 2024

đŸŽ¯ Location

Hinds Hall 243A

📋 Registration

If you would like to register for the workshop, please fill out this form: https://forms.gle/Y4DZUNv6JTfVRUEw5

Registration is open to all Syracuse University and SUNY ESF students, staff, and faculty. There is no fee, but space is limited, so sign up soon.

đŸ’ģ Prerequisites

Basic knowledge of Python, jupyter, conda environments, and git are required. For review, see the materials from our Summer 2024 Computing 101 Workshop.

You will need to bring your own computer. The computer should have jupyter notebook installed on it in a conda environment. If you do not have conda installed, follow the Miniconda installation instructions below. Once conda is installed, follow the Create a conda environment and install Jupyter instructions below.

If you have any trouble installing these, please come to the “Computer setup” time between 9AM-10AM on Thursday Dec. 12 for help.

Miniconda installation

Windows Users

  1. Open a web browser and go to https://www.anaconda.com/download/success. Do not download the Anaconda installer. Instead, scroll down to “Miniconda installers” and click on the Windows 64-Bit Graphical Installer to download.
  2. When the download completes, click “Open file” in the Downloads menu to launch the installer.
  3. Follow the on-screen instructions to install, noting the following:
    • When prompted who to install for, select “Just Me”.
    • Make sure that the “Create shortcuts” option is selected on the last screen, before clicking “Install”.
  4. Once the installation has completed you can launch a power shell with conda activated by going to the Windows Menu and selecting “Anaconda PowerShell Prompt”. This should open a new power shell window. You should see (base) to the left of the prompt. That indicates that conda is installed and active. You can now follow the Create a conda environment and install Jupyter instructions below.

MacOS/Linux Users

  1. Open a web browser and go to https://docs.anaconda.com/miniconda/install/#quick-command-line-install.
  2. Select the tab that corresponds to your operating system (macOS or Linux). Follow the instructions by copying the appropriate commands into a terminal window.
    • Mac users: note that these instructions are for Apple Silicon Macs (ones with an M1, M2, M3, or M4 processor). If you have an older (pre 2020) Intel-based x86 processor, go here and follow the instructions in the “Intel” tab inside the “MacOS terminal installer” tab.
  3. Once the installation is complete, open a new terminal window. You should see (base) to the left of the prompt. That indicates that conda is installed and active. You can now follow the Create a conda environment and install Jupyter instructions below.

Create a conda environment and install Jupyter

  1. Open a terminal shell (Anaconda PowerShell in Windows; Terminal in MacOS/Linux).
  2. Create a new environment and install jupyter into it by running:
    conda create -n python-workshop -c conda-forge -y jupyter
    This will create an environment called “python-workshop” with Jupyter installed in it.
  3. Activate your environment by typing
    conda activate python-workshop
  4. Start jupyter by typing
    jupyter notebook
    This will automatically open your web browser with Jupyter. You will be in your home directory. From here you can create and launch Jupyter notebooks, as well as navigate your file system.

Congratulations! You’ve installed Jupyter. In the workshop we will use Jupyter to create notebooks, do exercises, and install packages. To shutdown Jupyter, from the Jupyter menu bar in your web browser select “File -> Shut Down”. That will stop the Jupyter server and close your browser window. To exit your shell, go back to the shell and type “exit”.

To start Jupyter again, open a shell (Anaconda PowerShell in Windows; Terminal in MacOS/Linux) and repeat steps 3 and 4 above.

⏲ Schedule

The workshop will start at 10:00AM each day. We will also be available 9:00 – 10:00AM on the first day to help people setup their computers for the workshop.

Preliminary schedule (the exact topics covered in each session is subject to change):

Day Time Topics
Thurs. Dec. 12 9:00AM - 10:00AM Setup computers (optional)
Thurs. Dec. 12 10:00AM - 12:30PM Introduction to Python classes
Thurs. Dec. 12 1:30PM - 4:00PM Advanced function signature; Exceptions; debugging
Fri. Dec. 13 10:00AM - 12:30PM Data visualization & manipulation
Fri. Dec. 13 1:30PM - 4:00PM Statistics; curve fitting

📖 Workshop materials

The GitHub repository for the workshop is here:

https://github.com/SyracuseUniversity/ospo-workshop-advpython

This contains exercises and tutorials we will go through during the workshop, as well as a conda environment.yml file to install all of the needed dependencies.

More materials will be uploaded after the workshop.