GitHub

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ kernelspec:

99

name: python3

1010

---

1111
12+

(404)=

1213

# Page Not Found

1314
1415

```{raw} html

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ kernelspec:

99

name: python3

1010

---

1111
12+

(about_py)=

1213

```{raw} html

1314

<div id="qe-notebook-header" align="right" style="text-align:right;">

1415

<a href="https://quantecon.org/" title="quantecon.org">

@@ -192,6 +193,7 @@ The number you see here might vary slightly but it's essentially zero.

192193
193194

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

194195
196+

(tuple_unpacking_example)=

195197

For example, let's calculate $\int_{-2}^2 \phi(z) dz$ where $\phi$ is the standard normal density.

196198
197199

```{code-cell} python3

@@ -480,6 +482,7 @@ single: parallel computing; pycuda

480482
481483

* GPU programming through [PyCuda](https://wiki.tiker.net/PyCuda), [PyOpenCL](https://mathema.tician.de/software/pyopencl/), [Theano](http://deeplearning.net/software/theano/) or similar.

482484
485+

(intfc)=

483486

### Other Developments

484487
485488

There are many other interesting developments with scientific programming in Python.

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ kernelspec:

99

name: python3

1010

---

1111
12+

(debugging)=

1213

```{raw} html

1314

<div id="qe-notebook-header" align="right" style="text-align:right;">

1415

<a href="https://quantecon.org/" title="quantecon.org">

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ kernelspec:

99

name: python3

1010

---

1111
12+

(functions)=

1213

```{raw} html

1314

<div id="qe-notebook-header" align="right" style="text-align:right;">

1415

<a href="https://quantecon.org/" title="quantecon.org">

@@ -208,6 +209,7 @@ We will break this program into two parts:

208209
209210

This is accomplished in the next program

210211
212+

(funcloopprog)=

211213

```{code-cell} python3

212214

def generate_data(n):

213215

ϵ_values = []

@@ -237,6 +239,7 @@ Let's make it slightly more useful by giving it the ability to return either sta

237239
238240

This is achieved in the next piece of code.

239241
242+

(funcloopprog2)=

240243

```{code-cell} python3

241244

def generate_data(n, generator_type):

242245

ϵ_values = []

@@ -268,6 +271,7 @@ For example, we can get rid of the conditionals all together by just passing the

268271
269272

To understand this, consider the following version.

270273
274+

(test_program_6)=

271275

```{code-cell} python3

272276

def generate_data(n, generator_type):

273277

ϵ_values = []

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ kernelspec:

99

name: python3

1010

---

1111
12+

(getting_started)=

1213

```{raw} html

1314

<div id="qe-notebook-header" align="right" style="text-align:right;">

1415

<a href="https://quantecon.org/" title="quantecon.org">

@@ -63,6 +64,7 @@ Anaconda also comes with a great package management system to organize your code

6364
6465

**All of what follows assumes that you adopt this recommendation!**

6566
67+

(install_anaconda)=

6668

### Installing Anaconda

6769
6870

```{index}

@@ -89,6 +91,7 @@ As a practice run, please execute the following

8991
9092

For more information on conda, type conda help in a terminal.

9193
94+

(ipython_notebook)=

9295

## Jupyter Notebooks

9396
9497

```{index}

@@ -226,6 +229,7 @@ Python supports [unicode](https://docs.python.org/3/howto/unicode.html), allowin

226229
227230

In a code cell, try typing `\alpha` and then hitting the tab key on your keyboard.

228231
232+

(a_test_program)=

229233

#### A Test Program

230234
231235

Let's run a test program.

@@ -287,6 +291,7 @@ Jupyter offers up the two possible completions, `random` and `rank`.

287291
288292

In this way, the Tab key helps remind you of what's available and also saves you typing.

289293
294+

(gs_help)=

290295

#### On-Line Help

291296
292297

```{index}

@@ -354,6 +359,7 @@ to comments and votes by the community.

354359
355360

## Installing Libraries

356361
362+

(gs_qe)=

357363

```{index}

358364

single: QuantEcon

359365

```

@@ -364,6 +370,7 @@ Other libraries can be installed with `pip` or `conda`.

364370
365371

One library we'll be using is [QuantEcon.py](http://quantecon.org/quantecon-py).

366372
373+

(gs_install_qe)=

367374

You can install [QuantEcon.py](http://quantecon.org/quantecon-py) by

368375

starting Jupyter and typing

369376

@@ -484,6 +491,7 @@ You should now be able to run a standard Jupyter notebook session.

484491
485492

This is an alternative way to start the notebook that can also be handy.

486493
494+

(gs_ex2)=

487495

### Exercise 2

488496
489497

```{index}

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ kernelspec:

99

name: python3

1010

---

1111
12+

(index)=

1213

# Python Programming for Economics and Finance

1314
1415

```{toctree}

Original file line numberDiff line numberDiff line change

@@ -21,7 +21,9 @@ kernelspec:

2121
2222

This part provides a look at more advanced concepts in Python programming

2323
24+

```{only} html

2425

## Lectures

26+

```

2527
2628

```{toctree}

2729

:maxdepth: 2

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ kernelspec:

99

name: python3

1010

---

1111
12+

(learning_python)=

1213

```{raw} html

1314

<div id="qe-notebook-header" align="right" style="text-align:right;">

1415

<a href="https://quantecon.org/" title="quantecon.org">

@@ -21,7 +22,9 @@ kernelspec:

2122
2223

This first part of the course provides a relatively fast-paced introduction to the Python programming language

2324
25+

```{only} html

2426

## Lectures

27+

```

2528
2629

```{toctree}

2730

:maxdepth: 2

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ kernelspec:

99

name: python3

1010

---

1111
12+

(learning_python)=

1213

```{raw} html

1314

<div id="qe-notebook-header" align="right" style="text-align:right;">

1415

<a href="https://quantecon.org/" title="quantecon.org">

@@ -21,7 +22,9 @@ kernelspec:

2122
2223

Next we cover the third party libraries most useful for scientific work in Python

2324
25+

```{only} html

2426

## Lectures

27+

```

2528
2629

```{toctree}

2730

:maxdepth: 2

Original file line numberDiff line numberDiff line change

@@ -9,11 +9,14 @@ kernelspec:

99

name: python3

1010

---

1111
12+

(toc)=

1213

```{raw} html

1314

<p id="numfocus_badge" style="float:right;margin:0 0 0 2rem;"><a href="https://www.numfocus.org/"><img src="/_static/img/powered-by-NumFOCUS-orange.svg" alt="Powered by NumFOCUS logo"></a></p>

1415

```

1516
17+

```{only} html

1618

# Table of Contents

19+

```

1720
1821

```{toctree}

1922

---

@@ -43,9 +46,11 @@ scale: 30

4346

---

4447

```

4548
49+

```{only} latex

4650

Acknowledgements: These lectures have benefitted greatly from comments and

4751

suggestion from our colleagues, students and friends. Special thanks go to

4852

Anmol Bhandari, Long Bui, Jeong-Hun Choi, Chase Coleman, David Evans, Shunsuke Hori,

4953

Chenghan Hou, Doc-Jin Jang, Spencer Lyon, Qingyin Ma, Akira Matsushita,

5054

Matthew McKay, Tomohito Okabe, Alex Olssen, Nathan Palmer and Yixiao Zhou.

55+

```

5156

Read the original on github.com ↗