Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 100_Numpy_exercises_with_hints_with_solutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,8 @@ Z_start = (np.maximum(Z_start,0)).tolist()
R_stop = np.maximum(R_start, (R_stop - np.maximum(Z_stop-Zs,0))).tolist()
Z_stop = (np.minimum(Z_stop,Zs)).tolist()

r = [slice(start,stop) for start,stop in zip(R_start,R_stop)]
z = [slice(start,stop) for start,stop in zip(Z_start,Z_stop)]
r = tuple(slice(start,stop) for start,stop in zip(R_start,R_stop))
z = tuple(slice(start,stop) for start,stop in zip(Z_start,Z_stop))
R[r] = Z[z]
print(Z)
print(R)
Expand Down Expand Up @@ -1249,4 +1249,4 @@ idx = np.random.randint(0, X.size, (N, X.size))
means = X[idx].mean(axis=1)
confint = np.percentile(means, [2.5, 97.5])
print(confint)
```
```
6 changes: 3 additions & 3 deletions 100_Numpy_exercises_with_solutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,8 @@ Z_start = (np.maximum(Z_start,0)).tolist()
R_stop = np.maximum(R_start, (R_stop - np.maximum(Z_stop-Zs,0))).tolist()
Z_stop = (np.minimum(Z_stop,Zs)).tolist()

r = [slice(start,stop) for start,stop in zip(R_start,R_stop)]
z = [slice(start,stop) for start,stop in zip(Z_start,Z_stop)]
r = tuple(slice(start,stop) for start,stop in zip(R_start,R_stop))
z = tuple(slice(start,stop) for start,stop in zip(Z_start,Z_stop))
R[r] = Z[z]
print(Z)
print(R)
Expand Down Expand Up @@ -1249,4 +1249,4 @@ idx = np.random.randint(0, X.size, (N, X.size))
means = X[idx].mean(axis=1)
confint = np.percentile(means, [2.5, 97.5])
print(confint)
```
```
4 changes: 2 additions & 2 deletions source/exercises100.ktx
Original file line number Diff line number Diff line change
Expand Up @@ -1147,8 +1147,8 @@ Z_start = (np.maximum(Z_start,0)).tolist()
R_stop = np.maximum(R_start, (R_stop - np.maximum(Z_stop-Zs,0))).tolist()
Z_stop = (np.minimum(Z_stop,Zs)).tolist()

r = [slice(start,stop) for start,stop in zip(R_start,R_stop)]
z = [slice(start,stop) for start,stop in zip(Z_start,Z_stop)]
r = tuple(slice(start,stop) for start,stop in zip(R_start,R_stop))
z = tuple(slice(start,stop) for start,stop in zip(Z_start,Z_stop))
R[r] = Z[z]
print(Z)
print(R)
Expand Down