diff --git a/100_Numpy_exercises_with_hints_with_solutions.md b/100_Numpy_exercises_with_hints_with_solutions.md index 3c6d409..89d4f81 100644 --- a/100_Numpy_exercises_with_hints_with_solutions.md +++ b/100_Numpy_exercises_with_hints_with_solutions.md @@ -130,11 +130,6 @@ print(Z) Z = np.ones((5,5)) Z = np.pad(Z, pad_width=1, mode='constant', constant_values=0) print(Z) - -# Using fancy indexing -Z[:, [0, -1]] = 0 -Z[[0, -1], :] = 0 -print(Z) ``` #### 17. What is the result of the following expression? (★☆☆) ```python diff --git a/100_Numpy_exercises_with_solutions.md b/100_Numpy_exercises_with_solutions.md index 3ab3c91..b502669 100644 --- a/100_Numpy_exercises_with_solutions.md +++ b/100_Numpy_exercises_with_solutions.md @@ -130,11 +130,6 @@ print(Z) Z = np.ones((5,5)) Z = np.pad(Z, pad_width=1, mode='constant', constant_values=0) print(Z) - -# Using fancy indexing -Z[:, [0, -1]] = 0 -Z[[0, -1], :] = 0 -print(Z) ``` #### 17. What is the result of the following expression? (★☆☆) ```python diff --git a/source/exercises100.ktx b/source/exercises100.ktx index c0f1648..9af07a9 100644 --- a/source/exercises100.ktx +++ b/source/exercises100.ktx @@ -165,7 +165,7 @@ Z = np.ones((5,5)) Z = np.pad(Z, pad_width=1, mode='constant', constant_values=0) print(Z) -# Using fancy indexing +# Not a solution to this problem but good to know: using fancy indexing for in-place edit Z[:, [0, -1]] = 0 Z[[0, -1], :] = 0 print(Z)