GitHub

Original file line numberDiff line numberDiff line change

@@ -5,6 +5,7 @@ dask-worker-space

55
66

.vscode/

77

.ipynb_checkpoints/

8+

.virtual_documents/

89
910

lectures/mathfoo.py

1011

lectures/mod.py

Original file line numberDiff line numberDiff line change

@@ -25,7 +25,8 @@ sphinx:

2525

'https://keras.io/',

2626

'https://data.oecd.org/',

2727

'https://www.reddit.com/',

28-

'https://openai.com']

28+

'https://openai.com',

29+

'https://chatgpt.com/']

2930

html_favicon: _static/lectures-favicon.ico

3031

html_theme: quantecon_book_theme

3132

html_static_path: ['_static']

Original file line numberDiff line numberDiff line change

@@ -709,7 +709,7 @@ row, column = a.shape

709709

result = np.empty((3, 3))

710710

for i in range(row):

711711

for j in range(column):

712-

result[i, j] = a[i, j] + b[i]

712+

result[i, j] = a[i, j] + b[i,0]

713713
714714

result

715715

```

@@ -1474,6 +1474,17 @@ print(A)

14741474
14751475

**Part2**: Move on to replicate the result of the following broadcasting operation. Meanwhile, compare the speeds of broadcasting and the `for` loop you implement.

14761476
1477+

For this part of the exercise you can use the `tic`/`toc` functions from the `quantecon` library to time the execution.

1478+
1479+

Let's make sure this library is installed.

1480+
1481+

```{code-cell} python3

1482+

:tags: [hide-output]

1483+

!pip install quantecon

1484+

```

1485+
1486+

Now we can import the quantecon package.

1487+
14771488

```{code-cell} python3

14781489

import quantecon as qe

14791490
Original file line numberDiff line numberDiff line change

@@ -506,12 +506,7 @@ An important database for economists is [FRED](https://research.stlouisfed.org/f

506506
507507

For example, suppose that we are interested in the [unemployment rate](https://research.stlouisfed.org/fred2/series/UNRATE).

508508
509-

Via FRED, the entire series for the US civilian unemployment rate can be downloaded directly by entering

510-

this URL into your browser (note that this requires an internet connection)

511-
512-

(To download the data as a csv, click here: [https://research.stlouisfed.org/fred2/series/UNRATE/downloaddata/UNRATE.csv](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=1320&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-10-01&line_color=%234572a7&link_values=false&line_style=solid&mark_type=none&mw=3&lw=3&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-11-03&revision_date=2024-11-03&nd=1948-01-01))

513-
514-

This request returns a CSV file, which will be handled by your default application for this class of files.

509+

(To download the data as a csv, click on the top right `Download` and select the `CSV (data)` option).

515510
516511

Alternatively, we can access the CSV file from within a Python program.

517512

Read the original on github.com ↗