For this Python tutorial, we’re going to be working through a series of Jupyter notebooks, which we’ll execute using the free Anaconda package. Please use the following instructions to install Anaconda, start a Jupyter notebook session, and test your installation using two introductory notebooks before working through the remaining four notebooks one by one. Please follow the instructions in each notebook closely.
——————————————————————————————————————
Jupyter Notebooks and other Useful Information:
Astronomy Lite: [Here]
Blank Jupyter Notebooks: [Here]
Completed Jupyter Notebook Answer Key: [Here]
——————————————————————————————————————
Starting Jupyter Notebook:
- Once Anaconda Python is installed, look for the “Anaconda Navigator” application in your /Applications folder (Mac) or under the Start menu (Windows), and start that program.
- You’ll be asked about allowing the program to automatically report usage and errors to Continuum Analytics (the company that provides the Anaconda package). It’s up to you what you choose.
- After that, you should have a few selections to start from, one of which is the Jupyter program. Click “Launch” in that panel.
- This will open a web browser with a Jupyter tab. The first thing it will show is your current directory structure, likely for your home directory. From there you can navigate to any downloaded notebooks (like in your Downloads folder), or you can create new directories and new Python notebooks.
- For Mac users: Clicking “Launch” will actually start a terminal window that reports status updates for the Jupyter session. In some installations, the terminal will report an error that it couldn’t start the web browser tab and instructs you to copy and paste a link into a new browser window/tab. Once you copy the link, everything should work as described above.
——————————————————————————————————————
Tutorial Notebooks:
- From this site, please download the Notebooks.zip file and put it into a folder where you want to keep the results of the tutorial. This does not need to be any place specific, but remember the path you choose because you’ll need to navigate there from the Jupyter notebook start up page. Your Downloads folder is fine.
- Unzipping the file will create a file called “SIP Python Workshop”, with three subdirectories: data/, plots/, and programs/. From within the Jupyter notebook web browser tab, navigate to the programs directory.
- In that directory, you will see a set of *.ipynb files. These are the Jupyter notebooks that comprise the tutorial. The first two (1 Python Intro.ipynb and 2 SIP Intro.ipynb) are introductory notebooks that give you some introduction to programming, the python language, and the Jupyter environment. To start one of these notebooks, just click on the file name in the Jupyter browser tab. This should open a new tab with the contents of the notebook. To execute the contents of the cell, click on it and type Shift+Enter. Any errors in the installation should result in errors printed to the window when you execute cells with python code. Please attempt to start and run these two introductory notebooks as a test of your installation. Then go one by one through the remaining four notebooks.
——————————————————————————————————————
Here is some extra help:
- More info about PyaR Jupyter notebooks 1 and 2 (courtesy: Antara Bhattacharya): [Jupyter Notes (1 + 2)]