From 6adb66156d3053f96bf36ec5208e7a3ce1f0c24b Mon Sep 17 00:00:00 2001 From: kp992 Date: Mon, 12 May 2025 21:20:16 -0700 Subject: [PATCH 01/13] add initial mystmd setup --- lectures/_static/ccbysa.png | Bin 0 -> 17594 bytes lectures/foo.py | 2 + lectures/footer.md | 6 +++ lectures/myst.yml | 88 ++++++++++++++++++++++++++++++++++++ lectures/newfile.txt | 2 + lectures/numbers.txt | 6 +++ lectures/output.txt | 3 ++ lectures/output2.txt | 5 ++ lectures/test_table.csv | 11 +++++ lectures/us_cities.txt | 9 ++++ 10 files changed, 132 insertions(+) create mode 100644 lectures/_static/ccbysa.png create mode 100644 lectures/foo.py create mode 100644 lectures/footer.md create mode 100644 lectures/myst.yml create mode 100644 lectures/newfile.txt create mode 100644 lectures/numbers.txt create mode 100644 lectures/output.txt create mode 100644 lectures/output2.txt create mode 100644 lectures/test_table.csv create mode 100644 lectures/us_cities.txt diff --git a/lectures/_static/ccbysa.png b/lectures/_static/ccbysa.png new file mode 100644 index 0000000000000000000000000000000000000000..8770732928cb20d8aeafee32bec9c5de89d51238 GIT binary patch literal 17594 zcmZ{McQ}@P__v41&fb|B*@SGeH`yzj>`hko49ObgO9iJBF)*fd>*2Cp+T5|8N}=9pQhHd&=s2YPr~WzA$&UMtbq$1*e^}gNLQL zt2L*K`}3?_Q3@m^S|ml8C)z&QJ2@}(iKeFdJ3cFOX%?0#kk-&fhe~RPzQRP-9oMgZ zVY$cHFm0(QV;R%N#u^%mip9!;PVqiCnnhPwIT82Y&6j&7_}<<&nbufGzPT?`GClUh zu({XLwDd)(@6B~v)Lf#FA?33nQ6jxEL%eJ^Q;>ZAqot7KPUy$FxM3>)l~JwF?t~Qd z-+56DzZK$J-UzFqWDGAI)P~%WC*P7MJx4N()!|1&yzCZHkVL2x(mBpLu!0suq~8@+ z^?7)@TalADMz&@fw~28hUVQfl2Zs)LR#4v2zkidLXZo_4zihjog(Ua}sY-9o?spZ( zDwhG0D#vi&R9XnUp1fOF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t7EJ7Py8)k&xEEgJ%5YB;TQWJ*Pzte!&0@;`ajV z*(dB)iJ3ij(feQ%Qut-*;7!Ip#l2lI$>sOp3h~Da6W7YUWXv4?_N^yB#?#{Yb3NuX zL??ma3Bzc zP(#-+vOj@(2_}3swDiJ~V+mV6p9X{cwW3n^Zh0vx!N+IsKk7&c89BemrU`Rf+J*)% zheNo_u}=s$9taD!eCLOZVS8WU+soQ}+7f4A7V-ftQk0zU|U_eD# zdB{(X5!|#mo`SD2gv^^w)?ioAK$ffUm-`%9yy=e7z zsV~0V>mv*}Kw(8-fdcA?%&O7W2v4VW4T zqcxZnWqy0xcq=5#E%%fkEaO47m)Bh|$r7Jh!sa{y75qrOmGpen=X7qNkS*inZ?AS{ab>(=~=7 zni{swfQ$rvaqR{7=2n<$IE1d&4XOC|d?c1Co40__l6YAGIIO?`(*Y!dRgG|?y8m5W zcyKgBsmTRLXXC)-Pt()q75EHt(bvriOY)nGDr98qQW_~<{IFX#HZ}?y)XobaR{?g! zL`xbdgb+tA_?N;c?6rBv!NGxylCry}r;rJ~=JE*qRN)mmFvA`0FQe!fWP;45kWgM; zZnP%KBqH*8)ip0fG>!*U4S*Qj1nK-42nPG)(hPq01H7ce5WfWC|Mv#PY|M%mAztu> vk5D0%B4z(q5^F$?& Date: Thu, 15 May 2025 20:45:59 -0700 Subject: [PATCH 02/13] Remove div block headers --- lectures/about_py.md | 9 --------- lectures/debugging.md | 9 --------- lectures/functions.md | 9 --------- lectures/getting_started.md | 9 --------- lectures/matplotlib.md | 9 --------- lectures/myst.yml | 4 ++-- lectures/names.md | 9 --------- lectures/need_for_speed.md | 9 --------- lectures/numba.md | 9 --------- lectures/numpy.md | 8 -------- lectures/oop_intro.md | 9 --------- lectures/pandas.md | 9 --------- lectures/pandas_panel.md | 9 --------- lectures/parallelization.md | 8 -------- lectures/python_advanced_features.md | 9 --------- lectures/python_by_example.md | 8 -------- lectures/python_essentials.md | 9 --------- lectures/python_oop.md | 9 --------- lectures/scipy.md | 9 --------- lectures/sympy.md | 9 --------- lectures/troubleshooting.md | 8 -------- lectures/workspace.md | 9 --------- lectures/writing_good_code.md | 9 --------- 23 files changed, 2 insertions(+), 196 deletions(-) diff --git a/lectures/about_py.md b/lectures/about_py.md index a4ae3370..e97698b4 100644 --- a/lectures/about_py.md +++ b/lectures/about_py.md @@ -9,15 +9,6 @@ kernelspec: name: python3 --- -(about_py)= -```{raw} jupyter - -``` - ```{index} single: python ``` diff --git a/lectures/debugging.md b/lectures/debugging.md index ea40fc29..c53d7b8c 100644 --- a/lectures/debugging.md +++ b/lectures/debugging.md @@ -9,15 +9,6 @@ kernelspec: name: python3 --- -(debugging)= -```{raw} jupyter - -``` - # Debugging and Handling Errors ```{index} single: Debugging diff --git a/lectures/functions.md b/lectures/functions.md index 993d0765..ff904180 100644 --- a/lectures/functions.md +++ b/lectures/functions.md @@ -9,15 +9,6 @@ kernelspec: name: python3 --- -(functions)= -```{raw} jupyter - -``` - # Functions ```{index} single: Python; User-defined functions diff --git a/lectures/getting_started.md b/lectures/getting_started.md index d5645794..917a786f 100644 --- a/lectures/getting_started.md +++ b/lectures/getting_started.md @@ -9,15 +9,6 @@ kernelspec: name: python3 --- -(getting_started)= -```{raw} jupyter - -``` - - - # Getting Started -```{index} single: Python -``` ## Overview @@ -95,8 +79,6 @@ Anaconda also comes with a package management system to organize your code libra (install_anaconda)= ### Installing Anaconda -```{index} single: Python; Anaconda -``` To install Anaconda, [download](https://www.anaconda.com/download/) the binary and follow the instructions. @@ -119,16 +101,7 @@ As a practice run, please execute the following For more information on conda, type conda help in a terminal. (ipython_notebook)= -## {index}`Jupyter Notebooks ` - -```{index} single: Python; IPython -``` - -```{index} single: IPython -``` - -```{index} single: Jupyter -``` +## Jupyter Notebook [Jupyter](http://jupyter.org/) notebooks are one of the many possible ways to interact with Python and the scientific libraries. @@ -157,8 +130,6 @@ These lectures are designed for executing in Jupyter notebooks. ### Starting the Jupyter Notebook -```{index} single: Jupyter Notebook; Setup -``` Once you have installed Anaconda, you can start the Jupyter notebook. @@ -203,8 +174,6 @@ The notebook displays an *active cell*, into which you can type Python commands. ### Notebook Basics -```{index} single: Jupyter Notebook; Basics -``` Let's start with how to edit code and run simple programs. @@ -319,8 +288,6 @@ In this way, the Tab key helps remind you of what's available and also saves you (gs_help)= #### On-Line Help -```{index} single: Jupyter Notebook; Help -``` To get help on `np.random.randn`, we can execute `np.random.randn?`. @@ -357,8 +324,6 @@ Now we `Shift+Enter` to produce this ### Debugging Code -```{index} single: Jupyter Notebook; Debugging -``` Debugging is the process of identifying and removing errors from a program. @@ -393,11 +358,6 @@ You can explore more functionality of the debugger in the [Jupyter documentation ### Sharing Notebooks -```{index} single: Jupyter Notebook; Sharing -``` - -```{index} single: Jupyter Notebook; nbviewer -``` Notebook files are just text files structured in [JSON](https://en.wikipedia.org/wiki/JSON) and typically ending with `.ipynb`. @@ -430,10 +390,6 @@ to comments and votes by the community. ## Installing Libraries -(gs_qe)= -```{index} single: QuantEcon -``` - Most of the libraries we need come in Anaconda. Other libraries can be installed with `pip` or `conda`. @@ -511,10 +467,8 @@ following questions: 1. how should you execute it? 1. How should you modify or edit it? -#### Option 1: {index}`JupyterLab ` +#### Option 1: JupyterLab -```{index} single: JupyterLab -``` [JupyterLab](https://github.com/jupyterlab/jupyterlab) is an integrated development environment built on top of Jupyter notebooks. diff --git a/lectures/matplotlib.md b/lectures/matplotlib.md index 61746f64..9f388cf0 100644 --- a/lectures/matplotlib.md +++ b/lectures/matplotlib.md @@ -9,10 +9,8 @@ kernelspec: name: python3 --- -# {index}`Matplotlib ` +# Matplotlib -```{index} single: Python; Matplotlib -``` ## Overview @@ -40,8 +38,6 @@ But first, let's discuss the difference. ## The APIs -```{index} single: Matplotlib; Simple API -``` ### The MATLAB-style API @@ -138,8 +134,6 @@ We mention just a few. ### Multiple Plots on One Axis -```{index} single: Matplotlib; Multiple Plots on One Axis -``` It's straightforward to generate multiple plots on the same axes. @@ -162,9 +156,6 @@ plt.show() ### Multiple Subplots -```{index} single: Matplotlib; Subplots -``` - Sometimes we want multiple subplots in one figure. Here's an example that generates 6 histograms @@ -184,8 +175,6 @@ plt.show() ### 3D Plots -```{index} single: Matplotlib; 3D Plots -``` Matplotlib does a nice job of 3D plots --- here is one example diff --git a/lectures/names.md b/lectures/names.md index ea444a10..29c10c50 100644 --- a/lectures/names.md +++ b/lectures/names.md @@ -25,8 +25,6 @@ understanding of how names work in Python. (var_names)= ## Variable Names in Python -```{index} single: Python; Variable Names -``` Consider the Python statement @@ -87,9 +85,6 @@ You can [read more on garbage collection](https://rushter.com/blog/python-garbag ## Namespaces -```{index} single: Python; Namespaces -``` - Recall from the preceding discussion that the statement ```{code-cell} python3 @@ -202,8 +197,6 @@ math.__name__ ## Interactive Sessions -```{index} single: Python; Interpreter -``` In Python, **all** code executed by the interpreter runs in some module. @@ -256,8 +249,6 @@ import numpy as np ## The Global Namespace -```{index} single: Python; Namespace (Global) -``` Python documentation often makes reference to the "global namespace". @@ -285,8 +276,6 @@ In this case it's `__main__`, so the namespace of `__main__` again becomes the g ## Local Namespaces -```{index} single: Python; Namespace (Local) -``` Important fact: When we call a function, the interpreter creates a *local namespace* for that function, and registers the variables in that namespace. @@ -317,8 +306,6 @@ You can see the local namespace of `f` before it is destroyed. ## The `__builtins__` Namespace -```{index} single: Python; Namespace (__builtins__) -``` We have been using various built-in functions, such as `max(), dir(), str(), list(), len(), range(), type()`, etc. @@ -357,8 +344,6 @@ The next section explains how this works ... ## Name Resolution -```{index} single: Python; Namespace (Resolution) -``` Namespaces are great because they help us organize variable names. @@ -470,7 +455,7 @@ Note that the global `a` was not affected by the local `a`. (mutable_vs_immutable)= -### {index}`Mutable ` Versus {index}`Immutable ` Parameters +### Mutable Versus Immutable Parameters This is a good time to say a little more about mutable vs immutable objects. diff --git a/lectures/need_for_speed.md b/lectures/need_for_speed.md index 40644139..fe7c009e 100644 --- a/lectures/need_for_speed.md +++ b/lectures/need_for_speed.md @@ -149,8 +149,6 @@ In reading the following, remember that the Python interpreter executes code lin #### Dynamic Typing -```{index} single: Dynamic Typing -``` Consider this Python operation @@ -188,8 +186,6 @@ This involves substantial overheads. #### Static Types -```{index} single: Static Types -``` Compiled languages avoid these overheads with explicit, static types. @@ -258,12 +254,7 @@ In fact, it's generally true that memory traffic is a major culprit when it come Let's look at some ways around these problems. - - -## {index}`Vectorization ` - -```{index} single: Python; Vectorization -``` +## Vectorization There is a clever method called **vectorization** that can be used to speed up high level languages in numerical applications. diff --git a/lectures/numba.md b/lectures/numba.md index da976825..a6a29cd7 100644 --- a/lectures/numba.md +++ b/lectures/numba.md @@ -63,10 +63,8 @@ Numba will be a key part of our lectures --- especially those lectures involving This lecture introduces the main ideas. (numba_link)= -## {index}`Compiling Functions ` +## Compiling Functions -```{index} single: Python; Numba -``` As stated above, Numba's primary use is compiling functions to fast native machine code during runtime. @@ -397,8 +395,6 @@ plt.show() ## Alternatives to Numba -```{index} single: Python; Cython -``` There are additional options for accelerating Python loops. @@ -429,8 +425,6 @@ cumbersome than Numba. ### Interfacing with Fortran via F2Py -```{index} single: Python; Interfacing with Fortran -``` If you are comfortable writing Fortran you will find it very easy to create extension modules from Fortran code using [F2Py](https://docs.scipy.org/doc/numpy/f2py/). diff --git a/lectures/numpy.md b/lectures/numpy.md index a7154ab8..62749dbf 100644 --- a/lectures/numpy.md +++ b/lectures/numpy.md @@ -10,10 +10,7 @@ kernelspec: --- -# {index}`NumPy ` - -```{index} single: Python; NumPy -``` +# NumPy ```{epigraph} "Let's be clear: the work of science has nothing whatever to do with consensus. Consensus is the business of politics. Science, on the contrary, requires only one investigator who happens to be right, which means that he or she has results that are verifiable by reference to the real world. In science consensus is irrelevant. What is relevant is reproducible results." -- Michael Crichton @@ -50,8 +47,6 @@ from matplotlib import cm (numpy_array)= ## NumPy Arrays -```{index} single: NumPy; Arrays -``` The essential problem that NumPy solves is fast array processing. @@ -101,8 +96,6 @@ type(a[0]) (numpy_shape_dim)= ### Shape and Dimension -```{index} single: NumPy; Arrays (Shape and Dimension) -``` Consider the following assignment @@ -139,8 +132,6 @@ in `z = np.zeros((2, 2))`. (creating_arrays)= ### Creating Arrays -```{index} single: NumPy; Arrays (Creating) -``` As we've seen, the `np.zeros` function creates an array of zeros. @@ -208,8 +199,6 @@ or `np.genfromtxt`---see [the documentation](http://docs.scipy.org/doc/numpy/ref ### Array Indexing -```{index} single: NumPy; Arrays (Indexing) -``` For a flat array, indexing is the same as Python sequences: @@ -302,8 +291,6 @@ z ### Array Methods -```{index} single: NumPy; Arrays (Methods) -``` Arrays have useful methods, all of which are carefully optimized @@ -384,8 +371,6 @@ np.mean(a) ## Arithmetic Operations -```{index} single: NumPy; Arithmetic Operations -``` The operators `+`, `-`, `*`, `/` and `**` all act *elementwise* on arrays @@ -433,11 +418,6 @@ In particular, `A * B` is *not* the matrix product, it is an element-wise produc ## Matrix Multiplication -```{index} single: NumPy; Matrix Multiplication -``` - -```{index} single: NumPy; Matrix Multiplication -``` With Anaconda's scientific Python package based around Python 3.5 and above, one can use the `@` symbol for matrix multiplication, as follows: @@ -474,8 +454,6 @@ Since we are post-multiplying, the tuple is treated as a column vector. (broadcasting)= ## Broadcasting -```{index} single: NumPy; Broadcasting -``` (This section extends an excellent discussion of broadcasting provided by [Jake VanderPlas](https://jakevdp.github.io/PythonDataScienceHandbook/02.05-computation-on-arrays-broadcasting.html).) @@ -995,8 +973,6 @@ Let's look at some other useful things we can do with NumPy. ### Vectorized Functions -```{index} single: NumPy; Vectorized Functions -``` NumPy provides versions of the standard functions `log`, `exp`, `sin`, etc. that act *element-wise* on arrays @@ -1060,8 +1036,6 @@ However, this approach doesn't always obtain the same speed as a more carefully ### Comparisons -```{index} single: NumPy; Comparisons -``` As a rule, comparisons on arrays are done element-wise @@ -1135,12 +1109,6 @@ np.linalg.det(A) # Compute the determinant np.linalg.inv(A) # Compute the inverse ``` -```{index} single: SciPy -``` - -```{index} single: Python; SciPy -``` - Much of this functionality is also available in [SciPy](http://www.scipy.org/), a collection of modules that are built on top of NumPy. We'll cover the SciPy versions in more detail [soon](scipy.md). @@ -1150,8 +1118,6 @@ For a comprehensive list of what's available in NumPy see [this documentation](h ## Speed Comparisons -```{index} single: Vectorization; Operations on Arrays -``` We mentioned in an [previous lecture](need_for_speed.md) that NumPy-based vectorization can accelerate scientific applications. @@ -1204,8 +1170,6 @@ The next section illustrates this point. (ufuncs)= ### Universal Functions -```{index} single: NumPy; Universal Functions -``` As discussed above, many functions provided by NumPy are universal functions (ufuncs). diff --git a/lectures/oop_intro.md b/lectures/oop_intro.md index b26e194f..7d3e29e9 100644 --- a/lectures/oop_intro.md +++ b/lectures/oop_intro.md @@ -58,8 +58,6 @@ We'll make use of the following third party library ## Objects -```{index} single: Python; Objects -``` In Python, an *object* is a collection of data and instructions held in computer memory that consists of @@ -73,8 +71,6 @@ These concepts are defined and discussed sequentially below. (type)= ### Type -```{index} single: Python; Type -``` Python provides for different types of objects, to accommodate different categories of data. @@ -133,8 +129,6 @@ int('300') + 400 # To add as numbers, change the string to an integer (identity)= ### Identity -```{index} single: Python; Identity -``` In Python, each object has a unique identifier, which helps Python (and us) keep track of the object. @@ -156,8 +150,6 @@ The identity of an object is in fact just the address of the object in memory. ### Object Content: Data and Attributes -```{index} single: Python; Content -``` If we set `x = 42` then we create an object of type `int` that contains the data `42`. @@ -192,8 +184,6 @@ These attributes are important, so let's discuss them in-depth. (methods)= ### Methods -```{index} single: Python; Methods -``` Methods are *functions that are bundled with objects*. diff --git a/lectures/pandas.md b/lectures/pandas.md index 7309b19b..647fd1f5 100644 --- a/lectures/pandas.md +++ b/lectures/pandas.md @@ -11,10 +11,7 @@ kernelspec: name: python3 --- -# {index}`Pandas ` - -```{index} single: Python; Pandas -``` +# Pandas In addition to what’s in Anaconda, this lecture will need the following libraries: @@ -71,8 +68,6 @@ A `DataFrame` is a two-dimensional object for storing related columns of data. ## Series -```{index} single: Pandas; Series -``` Let's start with Series. @@ -134,8 +129,6 @@ s ## DataFrames -```{index} single: Pandas; DataFrames -``` While a `Series` is a single column of data, a `DataFrame` is several columns, one for each variable. @@ -485,8 +478,6 @@ plt.show() ## On-Line Data Sources -```{index} single: Data Sources -``` Python makes it straightforward to query online databases programmatically. @@ -502,10 +493,8 @@ This can be done with a variety of methods. We start with a relatively low-level method and then return to pandas. -### Accessing Data with {index}`requests ` +### Accessing Data with requests -```{index} single: Python; requests -``` One option is to use [requests](https://requests.readthedocs.io/en/master/), a standard Python library for requesting data over the Internet. @@ -581,7 +570,7 @@ Note that pandas offers many other file type alternatives. Pandas has [a wide variety](https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html) of top-level methods that we can use to read, excel, json, parquet or plug straight into a database server. -### Using {index}`wbgapi ` and {index}`yfinance ` to Access Data +### Using wbgapi and yfinance to Access Data The [wbgapi](https://pypi.org/project/wbgapi/) python library can be used to fetch data from the many databases published by the World Bank. diff --git a/lectures/pandas_panel.md b/lectures/pandas_panel.md index b17b2e2c..46ce71db 100644 --- a/lectures/pandas_panel.md +++ b/lectures/pandas_panel.md @@ -11,10 +11,7 @@ kernelspec: name: python3 --- -# {index}`Pandas for Panel Data ` - -```{index} single: Python; Pandas -``` +# Pandas for Panel Data In addition to what’s in Anaconda, this lecture will need the following libraries: diff --git a/lectures/python_advanced_features.md b/lectures/python_advanced_features.md index 4cb04dc9..cc42113f 100644 --- a/lectures/python_advanced_features.md +++ b/lectures/python_advanced_features.md @@ -24,8 +24,6 @@ A variety of topics are treated in the lecture, including iterators, decorators ## Iterables and Iterators -```{index} single: Python; Iteration -``` We've {ref}`already said something ` about iterating in Python. @@ -34,8 +32,6 @@ Now let's look more closely at how it all works, focusing in Python's implementa (iterators)= ### Iterators -```{index} single: Python; Iterators -``` Iterators are a uniform interface to stepping through elements in a collection. @@ -123,8 +119,6 @@ next(nikkei_data) ### Iterators in For Loops -```{index} single: Python; Iterators -``` All iterators can be placed to the right of the `in` keyword in `for` loop statements. @@ -162,8 +156,6 @@ This continues until a `StopIteration` error occurs. ### Iterables -```{index} single: Python; Iterables -``` You already know that we can put a Python list to the right of `in` in a `for` loop @@ -236,9 +228,6 @@ To conclude our discussion of `for` loops ### Iterators and built-ins -```{index} single: Python; Iterators -``` - Some built-in functions that act on sequences also work with iterables * `max()`, `min()`, `sum()`, `all()`, `any()` @@ -448,12 +437,6 @@ The difference is that functions with `*args` will be able to take *positional a ## Decorators and Descriptors -```{index} single: Python; Decorators -``` - -```{index} single: Python; Descriptors -``` - Let's look at some special syntax elements that are routinely used by Python developers. You might not need the following concepts immediately, but you will see them @@ -463,8 +446,6 @@ Hence you need to understand them at some stage of your Python education. ### Decorators -```{index} single: Python; Decorators -``` Decorators are a bit of syntactic sugar that, while easily avoided, have turned out to be popular. @@ -565,8 +546,6 @@ At the same time, the test logic is written only once. #### Enter Decorators -```{index} single: Python; Decorators -``` The last version of our code is still not ideal. @@ -621,8 +600,6 @@ In the opinion of many people, this makes the decorator syntax a significant imp (descriptors)= ### Descriptors -```{index} single: Python; Descriptors -``` Descriptors solve a common problem regarding management of variables. @@ -735,11 +712,6 @@ method is triggered --- in this case `set_miles`. #### Decorators and Properties -```{index} single: Python; Decorators -``` - -```{index} single: Python; Properties -``` These days its very common to see the `property` function used via a decorator. @@ -779,9 +751,6 @@ For further information you can refer to the [descriptor documentation](https:// (paf_generators)= ## Generators -```{index} single: Python; Generators -``` - A generator is a kind of iterator (i.e., it works with a `next` function). We will study two ways to build generators: generator expressions and generator functions. @@ -844,8 +813,6 @@ sum(x * x for x in range(10)) ### Generator Functions -```{index} single: Python; Generator Functions -``` The most flexible way to create generator objects is to use generator functions. diff --git a/lectures/python_by_example.md b/lectures/python_by_example.md index 915dafb8..98b032eb 100644 --- a/lectures/python_by_example.md +++ b/lectures/python_by_example.md @@ -12,8 +12,6 @@ kernelspec: # An Introductory Example -```{index} single: Python; Introductory Example -``` ## Overview @@ -99,8 +97,6 @@ to import additional functionality. #### Packages -```{index} single: Python; Packages -``` As stated above, NumPy is a Python package. @@ -124,8 +120,6 @@ print(np.__file__) #### Subpackages -```{index} single: Python; Subpackages -``` Consider the line `ϵ_values = np.random.randn(100)`. @@ -219,8 +213,6 @@ Let's study some parts of this program in more detail. (lists_ref)= ### Lists -```{index} single: Python; Lists -``` Consider the statement `ϵ_values = []`, which creates an empty list. @@ -281,8 +273,6 @@ x[1] # second element of x ### The For Loop -```{index} single: Python; For loop -``` Now let's consider the `for` loop from {ref}`the program above `, which was @@ -325,8 +315,6 @@ The Python interpreter performs the following: ### A Comment on Indentation -```{index} single: Python; Indentation -``` In discussing the `for` loop, we explained that the code blocks being looped over are delimited by indentation. @@ -351,8 +339,6 @@ On the other hand, it takes a bit of care to get right, so please remember: ### While Loops -```{index} single: Python; While loop -``` The `for` loop is the most common technique for iteration in Python. diff --git a/lectures/python_essentials.md b/lectures/python_essentials.md index b1d30d2a..01323c81 100644 --- a/lectures/python_essentials.md +++ b/lectures/python_essentials.md @@ -21,8 +21,6 @@ This approach is less exciting but helps clear up some details. ## Data Types -```{index} single: Python; Data Types -``` Computer programs typically keep track of a range of data types. @@ -121,8 +119,6 @@ Python has several basic types for storing collections of (possibly heterogeneou We've {ref}`already discussed lists `. -```{index} single: Python; Tuples -``` A related data type is **tuples**, which are "immutable" lists @@ -177,8 +173,6 @@ Tuple unpacking is convenient and we'll use it often. #### Slice Notation -```{index} single: Python; Slicing -``` To access multiple elements of a sequence (a list, a tuple or a string), you can use Python's slice notation. @@ -223,12 +217,6 @@ s[-3:] # Select the last three elements #### Sets and Dictionaries -```{index} single: Python; Sets -``` - -```{index} single: Python; Dictionaries -``` - Two other container types we should mention before moving on are [sets](https://docs.python.org/3/tutorial/datastructures.html#sets) and [dictionaries](https://docs.python.org/3/tutorial/datastructures.html#dictionaries). Dictionaries are much like lists, except that the items are named instead of @@ -273,9 +261,6 @@ s3 ## Input and Output -```{index} single: Python; IO -``` - Let's briefly review reading and writing to text files, starting with writing ```{code-cell} python3 @@ -397,9 +382,6 @@ that you could experiment with. ### Paths -```{index} single: Python; Paths -``` - Note that if `newfile.txt` is not in the present working directory then this call to `open()` fails. In this case, you can shift the file to the pwd or specify the [full path](https://en.wikipedia.org/wiki/Path_%28computing%29) to the file @@ -413,9 +395,6 @@ f = open('insert_full_path_to_file/newfile.txt', 'r') (iterating_version_1)= ## Iterating -```{index} single: Python; Iteration -``` - One of the most important tasks in computing is stepping through a sequence of data and performing a given action. @@ -527,8 +506,6 @@ for index, letter in enumerate(letter_list): (list_comprehensions)= ### List Comprehensions -```{index} single: Python; List comprehension -``` We can also simplify the code for generating the list of random draws considerably by using something called a *list comprehension*. @@ -558,8 +535,6 @@ doubles ### Comparisons -```{index} single: Python; Comparison -``` Many different kinds of expressions evaluate to one of the Boolean values (i.e., `True` or `False`). @@ -620,9 +595,6 @@ The rule is: ### Combining Expressions -```{index} single: Python; Logical Expressions -``` - We can combine expressions using `and`, `or` and `not`. These are the standard logical connectives (conjunction, disjunction and denial) @@ -676,8 +648,6 @@ documentation can make the code easier to understand and maintain. ### Python Style Guidelines: PEP8 -```{index} single: Python; PEP8 -``` You can find Python programming philosophy by typing `import this` at the prompt. @@ -698,8 +668,6 @@ In Python, the standard style is set out in [PEP8](https://www.python.org/dev/pe (Docstrings)= ### Docstrings -```{index} single: Python; Docstrings -``` Python has a system for adding comments to modules, classes, functions, etc. called *docstrings*. diff --git a/lectures/python_oop.md b/lectures/python_oop.md index 949e5d70..94c65e84 100644 --- a/lectures/python_oop.md +++ b/lectures/python_oop.md @@ -9,10 +9,8 @@ kernelspec: name: python3 --- -# {index}`OOP II: Building Classes ` +# OOP II: Building Classes -```{index} single: Python; Object-Oriented Programming -``` ## Overview @@ -65,8 +63,6 @@ Let's cover general OOP concepts before we specialize to Python. ### Key Concepts -```{index} single: Object-Oriented Programming; Key Concepts -``` As discussed an [earlier lecture](oop_intro.md), in the OOP paradigm, data and functions are **bundled together** into "objects". @@ -136,8 +132,6 @@ When we use OOP, the `simulate` method is conveniently bundled together with the ## Defining Your Own Classes -```{index} single: Object-Oriented Programming; Classes -``` Let's build some simple classes to start off. @@ -343,9 +337,6 @@ That's why the statement `self.wealth += y` inside `earn` ends up modifying `c1. (oop_solow_growth)= ### Example: The Solow Growth Model -```{index} single: Object-Oriented Programming; Methods -``` - For our next example, let's write a simple class to implement the Solow growth model. The Solow growth model is a neoclassical growth model in which the per capita @@ -685,8 +676,6 @@ Notice that there is no value of $r$ that leads to a steady state oscillating am ## Special Methods -```{index} single: Object-Oriented Programming; Special Methods -``` Python provides special methods that come in handy. diff --git a/lectures/scipy.md b/lectures/scipy.md index 84d042ba..c4729489 100644 --- a/lectures/scipy.md +++ b/lectures/scipy.md @@ -9,10 +9,7 @@ kernelspec: name: python3 --- -# {index}`SciPy ` - -```{index} single: Python; SciPy -``` +# SciPy ## Overview @@ -36,7 +33,7 @@ A more common approach is to get some idea of what's in the library and then loo In this lecture, we aim only to highlight some useful parts of the package. -## {index}`SciPy ` versus {index}`NumPy ` +## SciPy versus NumPy SciPy is a package that contains various tools that are built on top of NumPy, using its array data type and related functionality. @@ -67,8 +64,6 @@ Let's explore some of the major sub-packages. ## Statistics -```{index} single: SciPy; Statistics -``` The `scipy.stats` subpackage supplies @@ -201,10 +196,7 @@ The unique root is approximately 0.408. Let's consider some numerical techniques for finding roots. -### {index}`Bisection ` - -```{index} single: SciPy; Bisection -``` +### Bisection One of the most common algorithms for numerical root-finding is *bisection*. @@ -258,10 +250,7 @@ from scipy.optimize import bisect bisect(f, 0, 1) ``` -### The {index}`Newton-Raphson Method ` - -```{index} single: SciPy; Newton-Raphson Method -``` +### Newton-Raphson Method Another very common root-finding algorithm is the [Newton-Raphson method](https://en.wikipedia.org/wiki/Newton%27s_method). @@ -320,8 +309,6 @@ Here the correct solution is found and the speed is better than bisection: ### Multivariate Root-Finding -```{index} single: SciPy; Multivariate Root-Finding -``` Use `scipy.optimize.fsolve`, a wrapper for a hybrid method in MINPACK. @@ -331,8 +318,6 @@ See the [documentation](http://docs.scipy.org/doc/scipy/reference/generated/scip A **fixed point** of a real function $f$ on $[a,b]$ is an $x \in [a, b]$ such that $f(x)=x$. -```{index} single: SciPy; Fixed Points -``` SciPy has a function for finding (scalar) fixed points too @@ -345,10 +330,7 @@ fixed_point(lambda x: x**2, 10.0) # 10.0 is an initial guess If you don't get good results, you can always switch back to the `brentq` root finder, since the fixed point of a function $f$ is the root of $g(x) := x - f(x)$. -## {index}`Optimization ` - -```{index} single: SciPy; Optimization -``` +## Optimization Most numerical packages provide only functions for *minimization*. @@ -371,8 +353,6 @@ fminbound(lambda x: x**2, -1, 2) # Search in [-1, 2] ### Multivariate Optimization -```{index} single: Optimization; Multivariate -``` Multivariate local optimizers include `minimize`, `fmin`, `fmin_powell`, `fmin_cg`, `fmin_bfgs`, and `fmin_ncg`. @@ -380,10 +360,8 @@ Constrained multivariate local optimizers include `fmin_l_bfgs_b`, `fmin_tnc`, ` See the [documentation](http://docs.scipy.org/doc/scipy/reference/optimize.html) for details. -## {index}`Integration ` +## Integration -```{index} single: SciPy; Integration -``` Most numerical integration methods work by computing the integral of an approximating polynomial. @@ -410,10 +388,8 @@ There are also functions for multivariate integration. See the [documentation](http://docs.scipy.org/doc/scipy/reference/integrate.html) for more details. -## {index}`Linear Algebra ` +## Linear Algebra -```{index} single: SciPy; Linear Algebra -``` We saw that NumPy provides a module for linear algebra called `linalg`. diff --git a/lectures/sympy.md b/lectures/sympy.md index a70723d0..22210797 100644 --- a/lectures/sympy.md +++ b/lectures/sympy.md @@ -11,10 +11,7 @@ kernelspec: name: python3 --- -# {index}`SymPy ` - -```{index} single: Python; SymPy -``` +# SymPy ## Overview diff --git a/lectures/writing_good_code.md b/lectures/writing_good_code.md index 04832c49..427c93aa 100644 --- a/lectures/writing_good_code.md +++ b/lectures/writing_good_code.md @@ -11,9 +11,6 @@ kernelspec: # Writing Good Code -```{index} single: Models; Code style -``` - ```{epigraph} "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." -- Martin Fowler ```