12. Python Resources¶
This text provides an introduction to Python for science and engineering applications but is hardly exhaustive. There are many other resources that you will want to tap. Here I point out several that you may find useful.
12.1. Web resources¶
The best web resource for Python is a good search engine like Google. Nevertheless, I list a few web sites here that you might find useful. I have successfully resisted any attempt to be exhaustive so that the list is actually useful. Nevertheless, if you find a really cool site that you think should be on this list, please let me know.
- http://www.python.org/
- The official Python web site. I almost never look here.
- http://docs.python.org/2/reference/
- Sometimes I look here for detailed information about Python 2, which is the version used in this manual. Someday, when all the most useful packages are available for Python 3, we will switch to Python 3 and use http://docs.python.org/3/reference/ instead.
- http://docs.scipy.org/doc/numpy/reference/
- I usually start here when I need information about NumPy. It has links to just about all the NumPy documentation I need. By the way, I say “num-pee”, which rhymes with “bumpy”—a lot of people say “num-pie”, which doesn’t sound like English to me.
- http://docs.scipy.org/doc/scipy/reference/
- I start here when I need information about SciPy, its various packages and their functions. I say “psy-pi” for SciPy, like everyone else. Who says I have to be consistent? (see Emerson)
- http://matplotlib.org/api/pyplot_summary.html
- The Plotting Commands Summary page for MatPlotLib. It has a search feature and links to all the MatPlotLib documentation, which I use a lot. You can go the the main MatPlotLib page, http://matplotlib.org/, but frankly, it’s less useful. The site http://www.loria.fr/~rougier/teaching/matplotlib/ is also useful for learning some MatPlotLib tricks.
- http://ipython.org/
- I go to this page mostly to learn about IPython Notebook (http://ipython.org/notebook.html) but it’s also useful if you need information about the IPython interpreter, especially if you want to find out more about IPython magic commands.
- http://scipy-lectures.github.io/
- This link provides a web-based quick introduction to scientific Python that assumes you have some experience programming (not necessarily in Python). It’s terser than my introduction, but covers some useful topics that I do not cover.
- http://www.enthought.com/
- I get my latest version of Python and all the packages I need for scientific computing here. One stop shopping and everything is free for academic users. They offer three distributions: Express, Basic, and Professional. Express is free to all users and contains all the Python libraries, NumPy, MatPlotlib, SciPy, etc, that are described in this manual. Basic includes all the packages Enthought supports, which is likely to be everything you will ever need. Professional adds support services. Basic is free to academic users. One nice feature of Canopy is its package manager, which makes it child’s play to update or add Python packages. This is a very nice feature, especially for beginners. Canopy displaces the older Enthought EPD packages.
- https://pythonhosted.org/spyder/installation.html
- Get the latest version of Spyder, the alternative IDE to Enthought’s Canopy. Sypder is completely open source and has a number of nice features, like introspection, not currently available in Canopy. Spyder is very popular and can be installed easily on all platforms. For an effective package manager, see Anaconda (next entry).
- http://continuum.io/
- Anaconda provides a free distribution of Spyder with a comprehensive package manager, and may be the best choice for power users of Python for scientific programming. The package manager is run by line commands from a terminal window, which may put off beginners. Anaconda can be downloaded from https://store.continuum.io/cshop/anaconda/.
- http://www.scipy.org/Mailing_Lists
- Go here if you want to sign up for a mailing list for NumPy or SciPy, or if you want to report a bug. Mailing lists give you access to a community of developers and users that can often provide expert help. Just remember to be polite and respectful of those helping you and also to those posting questions.
- https://lists.sourceforge.net/lists/listinfo/matplotlib-users
- The mailing list for MatPlotLib. See paragraph immediately above.
- http://stackoverflow.com/
- StackOverflow may just be your best friend when it comes to solving problems using Python. You pose your question about whatever problem you are having with Python and other people write answers. The answers are monitored and the best survive. In fact, most of the questions you will pose have already been posed by someone else and answered. So you can just look up the answer to most of your questions. StackOverflow is a wonderful resource.
12.2. Books¶
There are a lot of books on Python and there is no way I can provide reviews for all of them. I have found that the book by Mark Lutz, Learning Python, published by O’Reilly Media does the trick for most people. It doesn’t have anything special for scientific programming, and thus does not cover the NumPy, SciPy, or MatPlotLib packages, but for just about everything else, it’s an excellent resource. It gives a good introduction to object oriented programming, or OOP, which I say little about in this text. The 3rd edition of the book covers Python 2 while the 4th and 5th (current) editions cover Python 3. You are probably better off getting the latest edition as everybody will soon be using Python 3. If you are using Python 2, as we do in this text, you can easily enough figure out the differences between Python 3 and 2.