Week 3#

Use the Navigation menu on the left to find the course content.

Last week had only one focus, NumPy. This week has more variety, but NumPy will continue to play a central role. We start out this week by discussing three topics which are used extensively by experienced Python programmers: list comprehension, f-strings, and lambda functions. The more comfortable you are with these topics, the more elegant your code will be. Code which makes appropriate use of these sorts of techniques is said to be Pythonic.

Next we introduce Matplotlib, which is the most important Python plotting library. The main syntax of Matplotlib is heavily influenced by Matlab, but don’t expect to be instantly comfortable with Matplotlib. The library is filled with so many different options that it can take some time to wrap your head around it. One nice side-effect of our introduction to Matplotlib is that we will see a clear example of what is called “Object-Oriented Programming”, in that our plotting functions (called “methods”) will usually be attached to an Axes object. Object-Oriented Programming is an important paradigm in programming, and we will briefly focus on it next week.

As an application of the material so far (especially NumPy and Matplotlib), we will end the week by using Python to investigate Newton’s Method.