View on GitHub

AstroPGH

2024 Python Boot Camp & Seminar Series

2020: GitHub / website (inc., Astropy, Pandas, Altair, Git/Github, linear regression, resampling, and debugging)

2021: GitHub / website (inc., Astropy and Pandas)

2022: GitHub / website (inc., Astropy and Pandas)

2023: GitHub / website

2024: GitHub / website

Welcome to the 2024 AstroPGH Python Boot Camp for summer undergraduate students and early PhD students new to Python. This 3 day program is designed to help you learn the basics of using Python for astrophysics and physics research.

Boot Camp

Installation and Setup

Python

Please install Python 3 before the Boot Camp. I recommend using the Anaconda package manager for Python 3.12. Here are Anaconda installation guides:

Next you need to start conda (which depends on your OS), so I suggest following this guide: How to start Conda

Then install the following packages by copy and pasting the following lines into the Anaconda prompt (search for ‘‘Anaconda Navigator’’) or terminal:

conda install numpy scipy pandas matplotlib astropy jupyter ipython
conda install -c conda-forge jupyterlab
pip install ipympl

If you have trouble with installing Jupyter Lab, see Jupyter Lab installation guide.

From the Anaconda prompt or terminal, launch Jupyter Lab (see Staring Jupyter Lab guide for more details):

jupyter lab

Test Your Conda Installation

  1. Open a new Anaconda prompt or terminal.
  2. Type ipython into the terminal to open an interactive python session (the prompt should say In [1]:).
  3. Copy this code:
    import numpy
    import scipy
    import matplotlib
    import astropy
    import pandas
    
  4. Type into the iPython shell the word paste, and press enter.
  5. If no errors are raised, you’re ready for bootcamp. You may close the terminal window.

If you are having difficulties with installation, please do not hesitate to reach out to Brett Andrews on Slack or via email.

Instructors

Schedule

Time (EDT) Monday (5/20) Tuesday (5/21) Wednesday (5/22)
10:00-11:15 Python Basics Numpy 1a Numpy 3a
11:45-1:00 Data Structures Numpy 1b Numpy 3b
2:00-3:15 Functions and Modules Numpy 2a Numpy 4a
3:45-5:00 Matplotlib Numpy 2b Numpy 4b

This material is based upon work supported by the National Science Foundation grant number AST-2009251. Any opinions, findings, and conclusions or recommendations expressed on this website are those of the participants and do not necessarily reflect the views of the National Science Foundation or the participating institutions.