Files for the Intro to Python workshops, presented by the IDEA Student Center of UC San Diego.
- python 2.x or 3.x
- jupyter notebook (formerly known as ipython-notebook)
- numpy
- matplotlib
We highly recommend installing Python and related scientific packages using Anaconda, a free Python distribution available for with Windows, macOS and Linux. To install:
- go to the Anaconda download page: https://www.anaconda.com/download/
- download the Python 3.x installer for your OS
- run the installer
NOTE: The installer is large (approx. 600 MB), and can take a while to download and run. Which is why we ask workshop participants to perform the installation before arriving to the workshop.
The Python code in this repository uses Jupyter Notebook, a popular graphical interface for writing and running Python code which uses your web browser. To start Jupyter Notebook, you can either:
- a) use the Anaconda Navigator app: open the app and click "Launch Jupyter Notebook"
- b) open a terminal (Windows: Anaconda Prompt, macOS: Terminal.app), type "jupyter notebook" (without quotes) and hit enter to execute the command
For either option, you should see a terminal window open briefly and then your default web browser should open, with the URL set as localhost:8888
.
If you're having trouble installing or running Python locally, you can try using the Binder online service to run the Python code:
NOTE The Binder service is free, but it is a temporary fix.
If you're switching to Python from Matlab, this guide covers most of the common code equivalents: https://docs.scipy.org/doc/numpy-dev/user/numpy-for-matlab-users.html
Examples of plotting with Matplotlib: http://matplotlib.org/gallery.html
Notes from a talk about writing beautiful Python code: https://gist.github.com/JeffPaine/6213790