Getting started
If you don’t already have Python installed on your machine, or if you don’t already have access to a cloud-based programming environment (like JupyterHub or Posit), this notebook will walk you through Google Colab, which is an excellent, free option if you want to program with Python and don’t want to have to install a bunch of programs on your computer. All you need to start this process is a Google account.
This tutorial will walk you through the basics of Colab. Click on this link, and it should take you to a page that looks like this:
This tutorial will walk you through the basics of Colab. Click on this link, and it should take you to a page that looks like this:
This notebook is hosted on GitHub, which is an open-source, collaborative programming resource. To use this notebook, you don’t need to have a GitHub account, but you will need to make a copy of the notebook to work with.
First, click on the button that says “Open in Colab.” (It looks more like an image than a link -- see below)
First, click on the button that says “Open in Colab.” (It looks more like an image than a link -- see below)
That should take you to a page that looks like this:
This has opened the Google Colab notebook. But you still need to make a copy for yourself, because if you make changes to this version, you will not be able to save them. Click on the text that says “Save a copy in Drive.” This will duplicate the notebook and save the copy in your own Google drive. Now you can edit it!
Go ahead and go through that tutorial, which gives you a quick introduction to Python. If you feel like you need a more in-depth Python preparation – either for yourself or for your students – check out one of the resources below.
Hint: go ahead and make yourself a blank Colab notebook so that you can practice as you follow along with the other resources. Just go to File > New Notebook and that will make a blank notebook that you can fill in with your own notes and code.
Go ahead and go through that tutorial, which gives you a quick introduction to Python. If you feel like you need a more in-depth Python preparation – either for yourself or for your students – check out one of the resources below.
Hint: go ahead and make yourself a blank Colab notebook so that you can practice as you follow along with the other resources. Just go to File > New Notebook and that will make a blank notebook that you can fill in with your own notes and code.
Now you are ready to move on to the Python resources!
DSECOP has compiled a list of helpful resources. I am reproducing them here with a little more information (and one addition).
DSECOP has compiled a list of helpful resources. I am reproducing them here with a little more information (and one addition).
- PHY 546: Python for Scientific Computing – this is a detailed course website that walks through using Python for scientific computing. You can follow along with your own Colab notebook, which you now know how to make!
- AST 390: Computational Astrophysics – this is another course, which looks at the use of Python specifically applied to astrophysics.
- Problem Solving with Python – this is a simple online text that goes through Python from the very basics. It’s a good resource for beginners – I have used it in a Computational Physics course with no coding prerequisites.
- A Whirlwind Tour of Python by Jake VanderPlas. – this is an online version of a textbook that goes through the Python programming language quickly. It assumes previous experience programming, but not in Python.
- Python Data Science Handbook by Jake VanderPlas. – this online book assumes knowledge of basic Python and really digs into the packages and tools that are useful for data science.
- Scientific Computing From Scratch organized by Pratyush Tiwary -- a coding bootcamp done in Colab to help you get started with data science tools in Python. This includes more advanced topics.