Another solution to question 96.
We can use np.unique with axis=0 to return unique rows of an array. For NumPy >= 1.13
This commit is contained in:
@@ -1157,8 +1157,8 @@ _, idx = np.unique(T, return_index=True)
|
||||
uZ = Z[idx]
|
||||
print(uZ)
|
||||
|
||||
# Another solution, for NumPy >= 1.13
|
||||
# Author: Andreas Kouzelis
|
||||
# For NumPy >= 1.13
|
||||
uZ = np.unique(Z, axis=0)
|
||||
print(uZ)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user