We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3241a07 commit c571121Copy full SHA for c571121
1 file changed
lectures/python_essentials.md
@@ -1068,10 +1068,11 @@ code.
1068
```{code-cell} python3
1069
import numpy as np
1070
1071
+rng = np.random.default_rng()
1072
n = 100
1073
ϵ_values = []
1074
for i in range(n):
- e = np.random.randn()
1075
+ e = rng.standard_normal()
1076
ϵ_values.append(e)
1077
```
1078
@@ -1085,8 +1086,9 @@ for i in range(n):
1085
1086
Here's one solution.
1087
1088
1089
1090
-ϵ_values = [np.random.randn() for i in range(n)]
1091
+ϵ_values = [rng.standard_normal() for i in range(n)]
1092
1093
1094
```{solution-end}
0 commit comments