We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 020bd2b commit efa490bCopy full SHA for efa490b
1 file changed
README.rst
@@ -563,6 +563,19 @@ Master
563
======
564
565
566
+1. Given a two dimensional array, how to extract unique rows ?
567
+
568
+ .. code:: python
569
570
+ # Jaime Fernández del Río
571
572
+ Z = np.random.randint(0,2,(6,6))
573
+ T = np.ascontiguousarray(Z).view(np.dtype((np.void, Z.dtype.itemsize * Z.shape[1])))
574
+ _, idx = np.unique(T, return_index=True)
575
+ uZ = Z[idx]
576
577
+ .. note:: See `stackoverflow <http://stackoverflow.com/questions/16970982/find-unique-rows-in-numpy-array/>`_ for explanations.
578
579
580
Archmaster
581
==========
0 commit comments