diff --git a/.gitignore b/.gitignore index 02d30563..d1e96dd0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ dask-worker-space .vscode/ .ipynb_checkpoints/ +.virtual_documents/ lectures/mathfoo.py lectures/mod.py diff --git a/lectures/_config.yml b/lectures/_config.yml index ed5d990d..78ea39d0 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -25,7 +25,8 @@ sphinx: 'https://keras.io/', 'https://data.oecd.org/', 'https://www.reddit.com/', - 'https://openai.com'] + 'https://openai.com', + 'https://chatgpt.com/'] html_favicon: _static/lectures-favicon.ico html_theme: quantecon_book_theme html_static_path: ['_static'] diff --git a/lectures/numpy.md b/lectures/numpy.md index ff495cc8..05dea077 100644 --- a/lectures/numpy.md +++ b/lectures/numpy.md @@ -709,7 +709,7 @@ row, column = a.shape result = np.empty((3, 3)) for i in range(row): for j in range(column): - result[i, j] = a[i, j] + b[i] + result[i, j] = a[i, j] + b[i,0] result ``` @@ -1474,6 +1474,17 @@ print(A) **Part2**: Move on to replicate the result of the following broadcasting operation. Meanwhile, compare the speeds of broadcasting and the `for` loop you implement. +For this part of the exercise you can use the `tic`/`toc` functions from the `quantecon` library to time the execution. + +Let's make sure this library is installed. + +```{code-cell} python3 +:tags: [hide-output] +!pip install quantecon +``` + +Now we can import the quantecon package. + ```{code-cell} python3 import quantecon as qe diff --git a/lectures/pandas.md b/lectures/pandas.md index 30096241..f3830973 100644 --- a/lectures/pandas.md +++ b/lectures/pandas.md @@ -506,12 +506,7 @@ An important database for economists is [FRED](https://research.stlouisfed.org/f For example, suppose that we are interested in the [unemployment rate](https://research.stlouisfed.org/fred2/series/UNRATE). -Via FRED, the entire series for the US civilian unemployment rate can be downloaded directly by entering -this URL into your browser (note that this requires an internet connection) - -(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)) - -This request returns a CSV file, which will be handled by your default application for this class of files. +(To download the data as a csv, click on the top right `Download` and select the `CSV (data)` option). Alternatively, we can access the CSV file from within a Python program.