Skip to content

Commit 969b067

Browse files
authored
Merge pull request rougier#1 from kuzand/kuzand-patch-1
Added another solution to question 96.
2 parents e163a64 + 5ec27f5 commit 969b067

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

100_Numpy_exercises.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,11 @@ T = np.ascontiguousarray(Z).view(np.dtype((np.void, Z.dtype.itemsize * Z.shape[1
11561156
_, idx = np.unique(T, return_index=True)
11571157
uZ = Z[idx]
11581158
print(uZ)
1159+
1160+
# Another solution, for NumPy >= 1.13
1161+
# Author: Andreas Kouzelis
1162+
uZ = np.unique(Z, axis=0)
1163+
print(uZ)
11591164
```
11601165

11611166
#### 97. Considering 2 vectors A & B, write the einsum equivalent of inner, outer, sum, and mul function (★★★)

0 commit comments

Comments
 (0)