Skip to content

Commit 0398e59

Browse files
committed
Make example in interactive shell copy-pastable.
Closes gh-240
1 parent 19f3728 commit 0398e59

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

layouts/partials/shell-lesson.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33

44
```python
55
>>> import numpy as np
6-
```
76

8-
Create a 2-D array, set every second element in some rows, and find max per
9-
row:
7+
>>> # Create a 2-D array, set every second element in
8+
>>> # some rows and find max per row:
109

11-
```python
1210
>>> x = np.arange(15, dtype=np.int64).reshape(3, 5)
1311
>>> x[1:, ::2] = -99
1412
>>> x
@@ -17,10 +15,8 @@
1715
[-99, 11, -99, 13, -99]])
1816
>>> x.max(axis=1)
1917
array([ 4, 8, 13])
20-
```
2118

22-
Generate some random numbers with an exponential distribution:
23-
```python
19+
>>> # Generate normally distributed random numbers:
2420
>>> rng = np.random.default_rng()
25-
>>> samples = rng.exponential(size=2500)
21+
>>> samples = rng.normal(size=2500)
2622
```

0 commit comments

Comments
 (0)