Skip to content

Commit 678d8ff

Browse files
Copilotmmcky
andauthored
Fix broken and deprecated URLs causing link checker failures (#380)
* Initial plan * Fix broken and deprecated URLs in about_py.md Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com> * Fix HTTP to HTTPS conversions and update deprecated URLs across all lecture files Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com> * Complete link fixing - resolve all remaining HTTP to HTTPS issues and update config Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com> * Final cleanup: fix remaining problematic HTTP links * [numpy] fix execution error --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com> Co-authored-by: mmcky <mamckay@gmail.com>
1 parent aef6fd5 commit 678d8ff

File tree

11 files changed

+70
-62
lines changed

11 files changed

+70
-62
lines changed

lectures/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ sphinx:
3333
html_theme_options:
3434
authors:
3535
- name: Thomas J. Sargent
36-
url: http://www.tomsargent.com/
36+
url: https://www.tomsargent.com/
3737
- name: John Stachurski
3838
url: https://johnstachurski.net/
3939
dark_logo: quantecon-logo-transparent.png

lectures/about_py.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Even if you don't yet know Python, you can see that the code is far simpler and
235235
import csv
236236
237237
total, count = 0, 0
238-
with open(data.csv, mode='r') as file:
238+
with open('data.csv', mode='r') as file:
239239
reader = csv.reader(file)
240240
for row in reader:
241241
try:
@@ -311,7 +311,7 @@ But when we want to work with larger arrays in real programs we need more effici
311311
For this we need to use libraries for working with arrays.
312312

313313
For Python, the most important matrix and array processing library is
314-
[NumPy](http://www.numpy.org/) library.
314+
[NumPy](https://www.numpy.org/) library.
315315

316316
For example, let's build a NumPy array with 100 elements
317317

@@ -365,7 +365,7 @@ This lecture series will provide you with extensive background in NumPy.
365365

366366
### SciPy
367367

368-
The [SciPy](http://www.scipy.org) library is built on top of NumPy and provides additional functionality.
368+
The [SciPy](https://www.scipy.org) library is built on top of NumPy and provides additional functionality.
369369

370370
(tuple_unpacking_example)=
371371
For example, let's calculate $\int_{-2}^2 \phi(z) dz$ where $\phi$ is the standard normal density.
@@ -381,14 +381,14 @@ value
381381

382382
SciPy includes many of the standard routines used in
383383

384-
* [linear algebra](http://docs.scipy.org/doc/scipy/reference/linalg.html)
385-
* [integration](http://docs.scipy.org/doc/scipy/reference/integrate.html)
386-
* [interpolation](http://docs.scipy.org/doc/scipy/reference/interpolate.html)
387-
* [optimization](http://docs.scipy.org/doc/scipy/reference/optimize.html)
388-
* [distributions and statistical techniques](http://docs.scipy.org/doc/scipy/reference/stats.html)
389-
* [signal processing](http://docs.scipy.org/doc/scipy/reference/signal.html)
384+
* [linear algebra](https://docs.scipy.org/doc/scipy/reference/linalg.html)
385+
* [integration](https://docs.scipy.org/doc/scipy/reference/integrate.html)
386+
* [interpolation](https://docs.scipy.org/doc/scipy/reference/interpolate.html)
387+
* [optimization](https://docs.scipy.org/doc/scipy/reference/optimize.html)
388+
* [distributions and statistical techniques](https://docs.scipy.org/doc/scipy/reference/stats.html)
389+
* [signal processing](https://docs.scipy.org/doc/scipy/reference/signal.html)
390390

391-
See them all [here](http://docs.scipy.org/doc/scipy/reference/index.html).
391+
See them all [here](https://docs.scipy.org/doc/scipy/reference/index.html).
392392

393393
Later we'll discuss SciPy in more detail.
394394

@@ -400,7 +400,7 @@ Later we'll discuss SciPy in more detail.
400400

401401
A major strength of Python is data visualization.
402402

403-
The most popular and comprehensive Python library for creating figures and graphs is [Matplotlib](http://matplotlib.org/), with functionality including
403+
The most popular and comprehensive Python library for creating figures and graphs is [Matplotlib](https://matplotlib.org/), with functionality including
404404

405405
* plots, histograms, contour images, 3D graphs, bar charts etc.
406406
* output in many formats (PDF, PNG, EPS, etc.)
@@ -427,10 +427,10 @@ More examples can be found in the [Matplotlib thumbnail gallery](https://matplot
427427

428428
Other graphics libraries include
429429

430-
* [Plotly](https://plot.ly/python/)
430+
* [Plotly](https://plotly.com/python/)
431431
* [seaborn](https://seaborn.pydata.org/) --- a high-level interface for matplotlib
432432
* [Altair](https://altair-viz.github.io/)
433-
* [Bokeh](http://bokeh.pydata.org/en/latest/)
433+
* [Bokeh](https://bokeh.pydata.org/en/latest/)
434434

435435
You can visit the [Python Graph Gallery](https://www.python-graph-gallery.com/) for more example plots drawn using a variety of libraries.
436436

@@ -452,7 +452,7 @@ Python has many libraries for studying networks and graphs.
452452
```{index} single: NetworkX
453453
```
454454

455-
One well-known example is [NetworkX](http://networkx.github.io/).
455+
One well-known example is [NetworkX](https://networkx.org/).
456456

457457
Its features include, among many other things:
458458

@@ -503,14 +503,14 @@ firms.
503503
Here's a short list of some important scientific libraries for Python not
504504
mentioned above.
505505

506-
* [SymPy](http://www.sympy.org/) for symbolic algebra, including limits, derivatives and integrals
507-
* [statsmodels](http://statsmodels.sourceforge.net/) for statistical routines
508-
* [scikit-learn](http://scikit-learn.org/) for machine learning
506+
* [SymPy](https://www.sympy.org/) for symbolic algebra, including limits, derivatives and integrals
507+
* [statsmodels](https://www.statsmodels.org/) for statistical routines
508+
* [scikit-learn](https://scikit-learn.org/) for machine learning
509509
* [Keras](https://keras.io/) for machine learning
510-
* [Pyro](https://pyro.ai/) and [PyStan](https://pystan.readthedocs.org/en/latest/) for Bayesian data analysis
510+
* [Pyro](https://pyro.ai/) and [PyStan](https://pystan.readthedocs.io/en/latest/) for Bayesian data analysis
511511
* [GeoPandas](https://geopandas.org/en/stable/) for spatial data analysis
512512
* [Dask](https://docs.dask.org/en/stable/) for parallelization
513-
* [Numba](http://numba.pydata.org/) for making Python run at the same speed as native machine code
513+
* [Numba](https://numba.pydata.org/) for making Python run at the same speed as native machine code
514514
* [CVXPY](https://www.cvxpy.org/) for convex optimization
515515
* [scikit-image](https://scikit-image.org/) and [OpenCV](https://opencv.org/) for processing and analyzing image data
516516
* [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) for extracting data from HTML and XML files

lectures/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ There are many other useful magics:
254254
* `%whos` gives a list of variables and their values
255255
* `%quickref` gives a list of magics
256256

257-
The full list of magics is [here](http://ipython.readthedocs.org/en/stable/interactive/magics.html).
257+
The full list of magics is [here](https://ipython.readthedocs.io/en/stable/interactive/magics.html).
258258

259259

260260
## Handling Errors

lectures/getting_started.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ For more information on conda, type conda help in a terminal.
139139
```{index} single: Jupyter
140140
```
141141

142-
[Jupyter](http://jupyter.org/) notebooks are one of the many possible ways to interact with Python and the scientific libraries.
142+
[Jupyter](https://jupyter.org/) notebooks are one of the many possible ways to interact with Python and the scientific libraries.
143143

144144
They use a *browser-based* interface to Python with
145145

@@ -149,7 +149,7 @@ They use a *browser-based* interface to Python with
149149

150150
Because of these features, Jupyter is now a major player in the scientific computing ecosystem.
151151

152-
Here's an image showing execution of some code (borrowed from [here](http://matplotlib.org/examples/pylab_examples/hexbin_demo.html)) in a Jupyter notebook
152+
Here's an image showing execution of some code (borrowed from [here](https://matplotlib.org/stable/gallery/statistics/hexbin_demo.html)) in a Jupyter notebook
153153

154154
```{figure} /_static/lecture_specific/getting_started/jp_demo.png
155155
:figclass: auto
@@ -269,7 +269,7 @@ In a code cell, try typing `\alpha` and then hitting the tab key on your keyboar
269269

270270
Let's run a test program.
271271

272-
Here's an arbitrary program we can use: [http://matplotlib.org/3.1.1/gallery/pie_and_polar_charts/polar_bar.html](http://matplotlib.org/3.1.1/gallery/pie_and_polar_charts/polar_bar.html).
272+
Here's an arbitrary program we can use: [https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_bar.html](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_bar.html).
273273

274274
On that page, you'll see the following code
275275

@@ -350,7 +350,7 @@ In addition to executing code, the Jupyter notebook allows you to embed text, eq
350350
For example, we can enter a mixture of plain text and LaTeX instead of code.
351351

352352
Next we `Esc` to enter command mode and then type `m` to indicate that we
353-
are writing [Markdown](http://daringfireball.net/projects/markdown/), a mark-up language similar to (but simpler than) LaTeX.
353+
are writing [Markdown](https://daringfireball.net/projects/markdown/), a mark-up language similar to (but simpler than) LaTeX.
354354

355355
(You can also use your mouse to select `Markdown` from the `Code` drop-down box just below the list of menu items)
356356

@@ -410,7 +410,7 @@ You can explore more functionality of the debugger in the [Jupyter documentation
410410

411411
Notebook files are just text files structured in [JSON](https://en.wikipedia.org/wiki/JSON) and typically ending with `.ipynb`.
412412

413-
You can share them in the usual way that you share files --- or by using web services such as [nbviewer](http://nbviewer.jupyter.org/).
413+
You can share them in the usual way that you share files --- or by using web services such as [nbviewer](https://nbviewer.jupyter.org/).
414414

415415
The notebooks you see on that site are **static** html representations.
416416

@@ -510,7 +510,7 @@ print("foobar")
510510

511511
This writes the line `print("foobar")` into a file called `foo.py` in the local directory.
512512

513-
Here `%%writefile` is an example of a [cell magic](http://ipython.readthedocs.org/en/stable/interactive/magics.html#cell-magics).
513+
Here `%%writefile` is an example of a [cell magic](https://ipython.readthedocs.io/en/stable/interactive/magics.html#cell-magics).
514514

515515
### Editing and Execution
516516

@@ -553,7 +553,7 @@ Right now, an extremely popular text editor for coding is [VS Code](https://code
553553

554554
VS Code is easy to use out of the box and has many high quality extensions.
555555

556-
Alternatively, if you want an outstanding free text editor and don't mind a seemingly vertical learning curve plus long days of pain and suffering while all your neural pathways are rewired, try [Vim](http://www.vim.org/).
556+
Alternatively, if you want an outstanding free text editor and don't mind a seemingly vertical learning curve plus long days of pain and suffering while all your neural pathways are rewired, try [Vim](https://www.vim.org/).
557557

558558
## Exercises
559559

lectures/matplotlib.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ kernelspec:
2525

2626
## Overview
2727

28-
We've already generated quite a few figures in these lectures using [Matplotlib](http://matplotlib.org/).
28+
We've already generated quite a few figures in these lectures using [Matplotlib](https://matplotlib.org/).
2929

3030
Matplotlib is an outstanding graphics library, designed for scientific computing, with
3131

@@ -438,9 +438,9 @@ plt.rcParams['figure.figsize'] = (10, 6)
438438

439439
## Further Reading
440440

441-
* The [Matplotlib gallery](http://matplotlib.org/gallery.html) provides many examples.
442-
* A nice [Matplotlib tutorial](http://scipy-lectures.org/intro/matplotlib/index.html) by Nicolas Rougier, Mike Muller and Gael Varoquaux.
443-
* [mpltools](http://tonysyu.github.io/mpltools/index.html) allows easy
441+
* The [Matplotlib gallery](https://matplotlib.org/stable/gallery/index.html) provides many examples.
442+
* A nice [Matplotlib tutorial](https://scipy-lectures.org/intro/matplotlib/index.html) by Nicolas Rougier, Mike Muller and Gael Varoquaux.
443+
* [mpltools](https://tonysyu.github.io/mpltools/index.html) allows easy
444444
switching between plot styles.
445445
* [Seaborn](https://github.com/mwaskom/seaborn) facilitates common statistics plots in Matplotlib.
446446

lectures/numba.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Another is that the set of algorithms that can be entirely vectorized is not uni
5656

5757
In fact, for some algorithms, vectorization is ineffective.
5858

59-
Fortunately, a new Python library called [Numba](http://numba.pydata.org/)
59+
Fortunately, a new Python library called [Numba](https://numba.pydata.org/)
6060
solves many of these problems.
6161

6262
It does so through something called **just in time (JIT) compilation**.

lectures/numpy.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ kernelspec:
2727
"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
2828
```
2929

30+
In addition to what's in Anaconda, this lecture will need the following libraries:
31+
32+
```{code-cell} ipython3
33+
:tags: [hide-output]
34+
35+
!pip install quantecon
36+
```
37+
3038
## Overview
3139

3240
[NumPy](https://en.wikipedia.org/wiki/NumPy) is a first-rate library for numerical programming
@@ -42,7 +50,7 @@ In this lecture, we will start a more systematic discussion of
4250
1. the fundamental array processing operations provided by NumPy.
4351

4452

45-
(For an alternative reference, see [the official NumPy documentation](http://docs.scipy.org/doc/numpy/reference/).)
53+
(For an alternative reference, see [the official NumPy documentation](https://docs.scipy.org/doc/numpy/reference/).)
4654

4755
We will use the following imports.
4856

@@ -64,11 +72,11 @@ from matplotlib import cm
6472
The essential problem that NumPy solves is fast array processing.
6573

6674
The most important structure that NumPy defines is an array data type, formally
67-
called a [numpy.ndarray](http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html).
75+
called a [numpy.ndarray](https://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html).
6876

6977
NumPy arrays power a very large proportion of the scientific Python ecosystem.
7078

71-
To create a NumPy array containing only zeros we use [np.zeros](http://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros.html#numpy.zeros)
79+
To create a NumPy array containing only zeros we use [np.zeros](https://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros.html#numpy.zeros)
7280

7381
```{code-cell} python3
7482
a = np.zeros(3)
@@ -212,7 +220,7 @@ na is np.array(na) # Does make a new copy --- perhaps unnecessarily
212220
```
213221

214222
To read in the array data from a text file containing numeric data use `np.loadtxt`
215-
or `np.genfromtxt`---see [the documentation](http://docs.scipy.org/doc/numpy/reference/routines.io.html) for details.
223+
or `np.genfromtxt`---see [the documentation](https://docs.scipy.org/doc/numpy/reference/routines.io.html) for details.
216224

217225
### Array Indexing
218226

@@ -456,7 +464,7 @@ B = np.ones((2, 2))
456464
A @ B
457465
```
458466

459-
(For older versions of Python and NumPy you need to use the [np.dot](http://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html) function)
467+
(For older versions of Python and NumPy you need to use the [np.dot](https://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html) function)
460468

461469
We can also use `@` to take the inner product of two flat arrays
462470

@@ -526,7 +534,7 @@ Here is a visual representation of this broadcasting operation:
526534
tags: [hide-input]
527535
---
528536
# Adapted and modified based on the code in the book written by Jake VanderPlas (see https://jakevdp.github.io/PythonDataScienceHandbook/06.00-figure-code.html#Broadcasting)
529-
# Originally from astroML: see http://www.astroml.org/book_figures/appendix/fig_broadcast_visual.html
537+
# Originally from astroML: see https://www.astroml.org/book_figures/appendix/fig_broadcast_visual.html
530538
531539
532540
def draw_cube(ax, xy, size, depth=0.4,
@@ -1155,7 +1163,7 @@ np.linalg.inv(A) # Compute the inverse
11551163
```{index} single: Python; SciPy
11561164
```
11571165

1158-
Much of this functionality is also available in [SciPy](http://www.scipy.org/), a collection of modules that are built on top of NumPy.
1166+
Much of this functionality is also available in [SciPy](https://www.scipy.org/), a collection of modules that are built on top of NumPy.
11591167

11601168
We'll cover the SciPy versions in more detail {doc}`soon <scipy>`.
11611169

lectures/pandas.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ In addition to what’s in Anaconda, this lecture will need the following librar
3636

3737
## Overview
3838

39-
[Pandas](http://pandas.pydata.org/) is a package of fast, efficient data analysis tools for Python.
39+
[Pandas](https://pandas.pydata.org/) is a package of fast, efficient data analysis tools for Python.
4040

4141
Its popularity has surged in recent years, coincident with the rise
4242
of fields such as data science and machine learning.
@@ -47,7 +47,7 @@ Here's a popularity comparison over time against Matlab and STATA courtesy of St
4747
:scale: 100
4848
```
4949

50-
Just as [NumPy](http://www.numpy.org/) provides the basic array data type plus core array operations, pandas
50+
Just as [NumPy](https://www.numpy.org/) provides the basic array data type plus core array operations, pandas
5151

5252
1. defines fundamental structures for working with data and
5353
1. endows them with methods that facilitate operations such as
@@ -58,7 +58,7 @@ Just as [NumPy](http://www.numpy.org/) provides the basic array data type plus c
5858
* dealing with missing values, etc., etc.
5959

6060
More sophisticated statistical functionality is left to other packages, such
61-
as [statsmodels](http://www.statsmodels.org/) and [scikit-learn](http://scikit-learn.org/), which are built on top of pandas.
61+
as [statsmodels](https://www.statsmodels.org/) and [scikit-learn](https://scikit-learn.org/), which are built on top of pandas.
6262

6363
This lecture will provide a basic introduction to pandas.
6464

@@ -536,7 +536,7 @@ In the second case, you can either
536536
* switch to another machine
537537
* solve your proxy problem by reading [the documentation](https://requests.readthedocs.io/en/master/)
538538

539-
Assuming that all is working, you can now proceed to use the `source` object returned by the call `requests.get('http://research.stlouisfed.org/fred2/series/UNRATE/downloaddata/UNRATE.csv')`
539+
Assuming that all is working, you can now proceed to use the `source` object returned by the call `requests.get('https://research.stlouisfed.org/fred2/series/UNRATE/downloaddata/UNRATE.csv')`
540540

541541
```{code-cell} ipython3
542542
url = 'https://fred.stlouisfed.org/graph/fredgraph.csv?bgcolor=%23e1e9f0&chart_type=line&drp=0&fo=open%20sans&graph_bgcolor=%23ffffff&height=450&mode=fred&recession_bars=on&txtcolor=%23444444&ts=12&tts=12&width=1318&nt=0&thu=0&trc=0&show_legend=yes&show_axis_titles=yes&show_tooltip=yes&id=UNRATE&scale=left&cosd=1948-01-01&coed=2024-06-01&line_color=%234572a7&link_values=false&line_style=solid&mark_type=none&mw=3&lw=2&ost=-99999&oet=99999&mma=0&fml=a&fq=Monthly&fam=avg&fgst=lin&fgsnd=2020-02-01&line_index=1&transformation=lin&vintage_date=2024-07-29&revision_date=2024-07-29&nd=1948-01-01'
@@ -604,9 +604,9 @@ in the exercises.
604604
For now let's work through one example of downloading and plotting data --- this
605605
time from the World Bank.
606606

607-
The World Bank [collects and organizes data](http://data.worldbank.org/indicator) on a huge range of indicators.
607+
The World Bank [collects and organizes data](https://data.worldbank.org/indicator) on a huge range of indicators.
608608

609-
For example, [here's](http://data.worldbank.org/indicator/GC.DOD.TOTL.GD.ZS/countries) some data on government debt as a ratio to GDP.
609+
For example, [here's](https://data.worldbank.org/indicator/GC.DOD.TOTL.GD.ZS/countries) some data on government debt as a ratio to GDP.
610610

611611
The next code example fetches the data for you and plots time series for the US and Australia
612612

lectures/parallelization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ To get some basis for comparison for the last example, let's try the same
185185
thing with Numba.
186186

187187
In fact there is an easy way to do this, since Numba can also be used to
188-
create custom {ref}`ufuncs <ufuncs>` with the [@vectorize](http://numba.pydata.org/numba-doc/dev/user/vectorize.html) decorator.
188+
create custom {ref}`ufuncs <ufuncs>` with the [@vectorize](https://numba.pydata.org/numba-doc/dev/user/vectorize.html) decorator.
189189

190190
```{code-cell} python3
191191
from numba import vectorize

0 commit comments

Comments
 (0)