Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ec0e0d0

Browse filesBrowse files
authored
update code-blocks due to code-cell with class no-execute for compat with sphinx-tojupyter (#110)
1 parent 41383e9 commit ec0e0d0
Copy full SHA for ec0e0d0

File tree

Expand file treeCollapse file tree

6 files changed

+38
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

6 files changed

+38
-0
lines changed
Open diff view settings
Collapse file

‎lectures/getting_started.md‎

Copy file name to clipboardExpand all lines: lectures/getting_started.md
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ You can install [QuantEcon.py](http://quantecon.org/quantecon-py) by
365365
starting Jupyter and typing
366366

367367
```{code-block} ipython3
368+
:class: no-execute
369+
368370
!conda install quantecon
369371
```
370372

@@ -373,6 +375,8 @@ into a cell.
373375
Alternatively, you can type the following into a terminal
374376

375377
```{code-block} bash
378+
:class: no-execute
379+
376380
conda install quantecon
377381
```
378382

@@ -381,6 +385,8 @@ More instructions can be found on the [library page](http://quantecon.org/quante
381385
To upgrade to the latest version, which you should do regularly, use
382386

383387
```{code-block} bash
388+
:class: no-execute
389+
384390
conda upgrade quantecon
385391
```
386392

@@ -389,6 +395,8 @@ Another library we will be using is [interpolation.py](https://github.com/EconFo
389395
This can be installed by typing in Jupyter
390396

391397
```{code-block} ipython3
398+
:class: no-execute
399+
392400
!conda install -c conda-forge interpolation
393401
```
394402

@@ -517,6 +525,8 @@ As the 1st task, try
517525
For example, if you've installed the command line version, open up a terminal and enter.
518526

519527
```{code-block} bash
528+
:class: no-execute
529+
520530
git clone https://github.com/QuantEcon/QuantEcon.py
521531
```
522532

Collapse file

‎lectures/need_for_speed.md‎

Copy file name to clipboardExpand all lines: lectures/need_for_speed.md
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ Compiled languages avoid these overheads with explicit, static types.
198198
For example, consider the following C code, which sums the integers from 1 to 10
199199

200200
```{code-block} c
201+
:class: no-execute
202+
201203
#include <stdio.h>
202204
203205
int main(void) {
Collapse file

‎lectures/python_advanced_features.md‎

Copy file name to clipboardExpand all lines: lectures/python_advanced_features.md
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ All iterators can be placed to the right of the `in` keyword in `for` loop state
143143
In fact this is how the `for` loop works: If we write
144144

145145
```{code-block} python3
146+
:class: no-execute
147+
146148
for x in iterator:
147149
<code block>
148150
```
@@ -156,6 +158,8 @@ then the interpreter
156158
So now you know how this magical looking syntax works
157159

158160
```{code-block} python3
161+
:class: no-execute
162+
159163
f = open('somefile.txt', 'r')
160164
for line in f:
161165
# do something
@@ -527,6 +531,8 @@ We are now working in the module `__main__`, and hence the namespace for `__main
527531
Next, we import a module called `amodule`
528532

529533
```{code-block} python3
534+
:class: no-execute
535+
530536
import amodule
531537
```
532538

@@ -1661,6 +1667,8 @@ Write a function to recursively compute the $t$-th Fibonacci number for any $t$.
16611667
Complete the following code, and test it using [this csv file](https://raw.githubusercontent.com/QuantEcon/lecture-python-programming/master/source/_static/lecture_specific/python_advanced_features/test_table.csv), which we assume that you've put in your current working directory
16621668

16631669
```{code-block} python3
1670+
:class: no-execute
1671+
16641672
def column_iterator(target_file, column_number):
16651673
"""A generator function for CSV files.
16661674
When called with a file name target_file (string) and column number
@@ -1681,6 +1689,8 @@ for date in dates:
16811689
Suppose we have a text file `numbers.txt` containing the following lines
16821690

16831691
```{code-block} none
1692+
:class: no-execute
1693+
16841694
prices
16851695
3
16861696
8
Collapse file

‎lectures/python_by_example.md‎

Copy file name to clipboardExpand all lines: lectures/python_by_example.md
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ easily enough if you look around.
145145
On this machine, it's located in
146146

147147
```{code-block} ipython
148+
:class: no-execute
149+
148150
anaconda3/lib/python3.7/site-packages/numpy
149151
```
150152

@@ -334,6 +336,8 @@ This example helps to clarify how the `for` loop works: When we execute a
334336
loop of the form
335337

336338
```{code-block} python3
339+
:class: no-execute
340+
337341
for variable_name in sequence:
338342
<code block>
339343
```
Collapse file

‎lectures/python_essentials.md‎

Copy file name to clipboardExpand all lines: lectures/python_essentials.md
+8Lines changed: 8 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ Note that if `newfile.txt` is not in the present working directory then this cal
315315
In this case, you can shift the file to the pwd or specify the [full path](https://en.wikipedia.org/wiki/Path_%28computing%29) to the file
316316

317317
```{code-block} python3
318+
:class: no-execute
319+
318320
f = open('insert_full_path_to_file/newfile.txt', 'r')
319321
```
320322

@@ -621,6 +623,8 @@ f?
621623
```
622624

623625
```{code-block} ipython
626+
:class: no-execute
627+
624628
Type: function
625629
String Form:<function f at 0x2223320>
626630
File: /home/john/temp/temp.py
@@ -633,6 +637,8 @@ f??
633637
```
634638

635639
```{code-block} ipython
640+
:class: no-execute
641+
636642
Type: function
637643
String Form:<function f at 0x2223320>
638644
File: /home/john/temp/temp.py
@@ -693,6 +699,8 @@ Here the function created by `lambda` is said to be *anonymous* because it was n
693699
In a {ref}`previous lecture <python_by_example>`, you came across the statement
694700

695701
```{code-block} python3
702+
:class: no-execute
703+
696704
plt.plot(x, 'b-', label="white noise")
697705
```
698706

Collapse file

‎lectures/python_oop.md‎

Copy file name to clipboardExpand all lines: lectures/python_oop.md
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ Implement $F_n$ as a class called `ECDF`, where
777777
Your code should work as follows (modulo randomness)
778778

779779
```{code-block} python3
780+
:class: no-execute
781+
780782
from random import uniform
781783
782784
samples = [uniform(0, 1) for i in range(10)]
@@ -785,6 +787,8 @@ F(0.5) # Evaluate ecdf at x = 0.5
785787
```
786788

787789
```{code-block} python3
790+
:class: no-execute
791+
788792
F.observations = [uniform(0, 1) for i in range(1000)]
789793
F(0.5)
790794
```

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.