Merge pull request #70 from kuzand/kuzand-patch-1
Another solution to question 96
This commit is contained in:
commit
a135916843
@ -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)
|
||||
|
||||
# Author: Andreas Kouzelis
|
||||
# NumPy >= 1.13
|
||||
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 (★★★)
|
||||
|
@ -606,7 +606,7 @@ np.sqrt(-1) == np.emath.sqrt(-1)
|
||||
|
||||
#### 96. Given a two dimensional array, how to extract unique rows? (★★★)
|
||||
|
||||
(**hint**: np.ascontiguousarray)
|
||||
(**hint**: np.ascontiguousarray | np.unique)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user