On this page, we attempt to maintain an annotated directory of the content of this blog.
Pages
There are 6 static pages in this blog:
Home: The home page, where you can find a brief overview of the blog and the most recent posts.
Code: A page where you can download a collection of Python code samples, or copy and paste them directly from the Web page.
Data Sets: A page where you can download a collection of data sets, some of which are required for the exercises in A Student’s Guide to Python for Physical Modeling.
Errata: A page that contains known errors and corrections for A Student’s Guide to Python for Physical Modeling.
Resources: A page of additional resources, both print and digital.
Contents: The current page, a Table of Contents for the blog.
Blog Posts
The list of posts, in the order in which they were published to the blog:
Welcome! — An introduction to the blog.
Making Plots for Publication — We discuss some tips and tricks for adjusting plots generated by PyPlot in order to meet the style requirements of some journals. We also provide a module that automates some of these adjustments.
Python Code in LaTeX — We explain how to produce Python code with syntax highlight in LaTeX documents. We also provide style files that will reproduce the appearance of code samples in A Student’s Guide to Python for Physical Modeling.
Interpolation — We explain the basics of interpolation (estimating the value of a function between sampled points) and describe how to use the
interp1d
function from thescipy.interpolate
module.Raising a Figure Window to the Foreground — We describe how to force a figure window to the foreground of your operating system using either the Qt or Tkinter graphics backend. (Plots created by Spyder are sometiems hard to locate.)
Displaying Plots Inside Loops — We explain how to display figures during the execution of a loop using PyPlot’s
waitforbuttonpress()
method. Python’s default behavior is to display nothing until the loop exits, regardless of how many figures you create.Illuminating Surface Plots — We describe how to use the
LightSource
class from thematplotlib.colors
module to control the illumination and shading of three-dimensional surface plots.Function Arguments:
*args
and**kwargs
— We describe positional and named arguments in Python functions, the wildcard arguments*args
and**kwargs
, and how to use this notation to pass arguments to functions.Lists, Comprehensions, and Generators — We describe Python lists, a special Python construct for creating lists called a list comprehension, and a similar construct called a generator expression.
Speeding Up Python — Part 1: Profiling — This is the first of a two-part discussion of profiling and optimization in Python. We explain what profiling is, introduce several command-line tools for profiling Python programs, and provide some tips for effective profiling.
Speeding Up Python — Part 2: Optimization — This is the second of a two-part discussion of profiling and optimization in Python. We use these tools described in the previous post to demonstrate some general principles that improve the performance of Python programs.
Paths in Python — We discuss how you can manage the collection of directories searched by Python. This makes it simple to access modules you write or download in other Python programs.
Jupyter Notebooks — We introduce Jupyter notebooks with a working example. A Jupyter notebook is an interactive document that incorporates text, math, graphics, and code. This make Jupyter notebooks very useful for presenting your work or sharing it with others.
A Few Updates — We describe a few significant updates to Python and the Anaconda distribution of Python since the publication of the first edition of A Student’s Guide to Python for Physical Modeling in 2015. We also discuss our upcoming revised edition of the book.
Comments