turicreate.SFrame.unique¶
-
SFrame.
unique
()¶ Remove duplicate rows of the SFrame. Will not necessarily preserve the order of the given SFrame in the new SFrame.
Returns: - out : SFrame
A new SFrame that contains the unique rows of the current SFrame.
Raises: - TypeError
If any column in the SFrame is a dictionary type.
See also
Examples
>>> sf = turicreate.SFrame({'id':[1,2,3,3,4], 'value':[1,2,3,3,4]}) >>> sf +----+-------+ | id | value | +----+-------+ | 1 | 1 | | 2 | 2 | | 3 | 3 | | 3 | 3 | | 4 | 4 | +----+-------+ [5 rows x 2 columns]
>>> sf.unique() +----+-------+ | id | value | +----+-------+ | 2 | 2 | | 4 | 4 | | 3 | 3 | | 1 | 1 | +----+-------+ [4 rows x 2 columns]