Skip to content

Commit 522cea2

Browse files
committed
fix code linking reference issues
1 parent ac58b7f commit 522cea2

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

lectures/functions.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ We will break this program into two parts:
286286

287287
This is accomplished in the next program
288288

289-
(funcloopprog)=
290289
```{code-cell} python3
291290
def generate_data(n):
292291
ϵ_values = []
@@ -313,7 +312,6 @@ Let's make it slightly more useful by giving it the ability to return either sta
313312

314313
This is achieved in the next piece of code.
315314

316-
(funcloopprog2)=
317315
```{code-cell} python3
318316
def generate_data(n, generator_type):
319317
ϵ_values = []
@@ -345,7 +343,6 @@ For example, we can get rid of the conditionals all together by just passing the
345343

346344
To understand this, consider the following version.
347345

348-
(test_program_6)=
349346
```{code-cell} python3
350347
def generate_data(n, generator_type):
351348
ϵ_values = []
@@ -439,7 +436,6 @@ This example is somewhat contrived, since the first (iterative) solution would u
439436
We'll meet less contrived applications of recursion later on.
440437

441438

442-
(factorial_exercise)=
443439
## Exercises
444440

445441
```{exercise-start}

lectures/python_advanced_features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Formally, an *iterator* is an object with a `__next__` method.
4141

4242
For example, file objects are iterators .
4343

44-
To see this, let's have another look at the {ref}`US cities data <us_cities_data>`,
44+
To see this, let's have another look at the {ref}`US cities data <us_cities_data-code>`,
4545
which is written to the present working directory in the following cell
4646

4747
```{code-cell} ipython

lectures/python_by_example.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ The `for` loop is the most common technique for iteration in Python.
344344

345345
But, for the purpose of illustration, let's modify {ref}`the program above <firstloopprog-code>` to use a `while` loop instead.
346346

347-
(whileloopprog)=
348347
```{code-cell} python3
349348
ts_length = 100
350349
ϵ_values = []

lectures/python_essentials.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,9 @@ Many Python objects are "iterable", in the sense that they can be looped over.
407407

408408
To give an example, let's write the file us_cities.txt, which lists US cities and their population, to the present working directory.
409409

410-
(us_cities_data)=
411410
```{code-cell} ipython
411+
:name: us_cities_data
412+
412413
%%writefile us_cities.txt
413414
new york: 8244910
414415
los angeles: 3819702
@@ -657,7 +658,7 @@ We've all heard the saying about consistency and little minds.
657658

658659
In programming, as in mathematics, the opposite is true
659660

660-
* A mathematical paper where the symbols $\cup$ and $\cap$ were
661+
* A mathematical paper where the symbols `$\cup$` and `$\cap$` were
661662
reversed would be very hard to read, even if the author told you so on the
662663
first page.
663664

lectures/scipy.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,9 @@ Here's a simplistic implementation of the algorithm in Python.
215215

216216
It works for all sufficiently well behaved increasing continuous functions with $f(a) < 0 < f(b)$
217217

218-
(bisect_func)=
219218
```{code-cell} python3
219+
:name: bisect_func
220+
220221
def bisect(f, a, b, tol=10e-5):
221222
"""
222223
Implements the bisection root finding algorithm, assuming that f is a
@@ -538,7 +539,7 @@ print(f"The Monte Carlo option price is {P:3f}")
538539
539540
In [this lecture](functions.md), we discussed the concept of {ref}`recursive function calls <recursive_functions>`.
540541
541-
Try to write a recursive implementation of the homemade bisection function {ref}`described above <bisect_func>`.
542+
Try to write a recursive implementation of the homemade bisection function {ref}`described above <bisect_func-code>`.
542543
543544
Test it on the function {eq}`root_f`.
544545
```

0 commit comments

Comments
 (0)