Skip to content

Commit 06dc2b6

Browse files
committed
Update translation: lectures/python_essentials.md
1 parent 4d9ab6e commit 06dc2b6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lectures/python_essentials.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,10 +1063,11 @@ def linapprox(f, a, b, n, x):
10631063
```{code-cell} python3
10641064
import numpy as np
10651065
1066+
rng = np.random.default_rng()
10661067
n = 100
10671068
ϵ_values = []
10681069
for i in range(n):
1069-
e = np.random.randn()
1070+
e = rng.standard_normal()
10701071
ϵ_values.append(e)
10711072
```
10721073

@@ -1080,9 +1081,10 @@ for i in range(n):
10801081
یک راه‌حل این است:
10811082

10821083
```{code-cell} python3
1084+
rng = np.random.default_rng()
10831085
n = 100
1084-
ϵ_values = [np.random.randn() for i in range(n)]
1086+
ϵ_values = [rng.standard_normal() for i in range(n)]
10851087
```
10861088

10871089
```{solution-end}
1088-
```
1090+
```

0 commit comments

Comments
 (0)