Python Programming
Here is a series of introductions to Python programming—programming
oriented towards scientific and mathematical uses. I recommend working
through them in order. We are going to work through one per week in the
order given below. They are the focus of the Thursday programming lab.
Keep the book Learning
Python nearby and learn to use it as a reference. The series
of introductions is intended to get to useful scientific
programming quickly and, in doing so, leaves out many of the
details that the book systematically develops.
iPython
Have iPython
running so that you can test what the introductions describe as you read
along. To get started with iPython go to the
tutorial.
The introductions are very schematic. They assume you will use
iPython to probe around and test the features and commands that
are described. If something's confusing, look up the relevant sections in
the Python book or in the online Python documentation, whose
links are given below.
Exercises
There are programming
exercises.
These will be assigned each Thursday. Solutions are due
one week later on the following Thursday. They are to be emailed to the
TA.
Programming Labs
- Part A: Data Types and Calculating,
Exercises A.
- Part B: Strings, Lists, Tuples, Loops, Conditionals, File I/O,
Exercises B.
- Part C: Dictionaries, Arrays, Functions, and Modules,
Exercises C.
- Part D: Statistics, Linear Algebra, and Plotting,
Exercises D.
- Part E: Plotting and One-Dimensional Dynamics,
Exercises E.
- Part F: Numerical Integration and Visualization,
Exercises F.
- Part G: Quantifying Chaos,
Exercises G.
What's Next?
As a next pass to deepen your understanding of the Python language
itself, once we've gone through the (about a dozen) introductory lessons,
you might want to work through the
Python tutorial,
which is not focused on scientific computing. It is a more systematic
introduction to Python the language than the above. There are
extensive online documents
here.
Documentation for the NumPy numerical Python package is
here.
And the documentation for the Scientific package is found in its
manual. Other
suggestions for Python documentation are given in the
Supplemental
Reading list.
chaos@cse.ucdavis.edu
Last updated 8 April 2008