From 5ec27f54c8dc34e3d307bd66dc29585a74e70751 Mon Sep 17 00:00:00 2001 From: kuzand Date: Fri, 2 Nov 2018 15:23:51 +0200 Subject: [PATCH] Added another solution to question 96. --- 100_Numpy_exercises.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/100_Numpy_exercises.md b/100_Numpy_exercises.md index 14ae2c5..c93c54b 100644 --- a/100_Numpy_exercises.md +++ b/100_Numpy_exercises.md @@ -1156,6 +1156,11 @@ T = np.ascontiguousarray(Z).view(np.dtype((np.void, Z.dtype.itemsize * Z.shape[1 _, idx = np.unique(T, return_index=True) uZ = Z[idx] print(uZ) + +# Another solution, for NumPy >= 1.13 +# Author: Andreas Kouzelis +uZ = np.unique(Z, axis=0) +print(uZ) ``` #### 97. Considering 2 vectors A & B, write the einsum equivalent of inner, outer, sum, and mul function (★★★)