diff --git a/spec/API_specification/dataframe_api/column_object.py b/spec/API_specification/dataframe_api/column_object.py index a2145830..e402cbf6 100644 --- a/spec/API_specification/dataframe_api/column_object.py +++ b/spec/API_specification/dataframe_api/column_object.py @@ -430,3 +430,24 @@ def isnan(self) -> Column: Does *not* include 'missing' or 'null' entries. In particular, does not check for `np.timedelta64('NaT')`. """ + + def unique_indices(self, *, skip_nulls: bool = True) -> Column[int]: + """ + Return indices corresponding to unique values in Column. + + Returns + ------- + Column[int] + Indices corresponding to unique values. + + Notes + ----- + There are no ordering guarantees. In particular, if there are multiple + indices corresponding to the same unique value, there is no guarantee + about which one will appear in the result. + If the original Column contains multiple `'NaN'` values, then + only a single index corresponding to those values should be returned. + Likewise for null values (if ``skip_nulls=False``). + To get the unique values, you can do ``col.get_rows(col.unique_indices())``. + """ + ...