diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index cd109a7e..099d50e3 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -65,13 +65,13 @@ def shape(self) -> tuple[int, int]: Return number of rows and number of columns. """ - def groupby(self, keys: Sequence[str], /) -> GroupBy: + def groupby(self, keys: str | list[str], /) -> GroupBy: """ Group the DataFrame by the given columns. Parameters ---------- - keys : Sequence[str] + keys : str | list[str] Returns ------- @@ -247,7 +247,7 @@ def get_column_names(self) -> Sequence[str]: def sort( self, - keys: Sequence[str] | None = None, + keys: str | list[str] | None = None, *, ascending: Sequence[bool] | bool = True, nulls_position: Literal['first', 'last'] = 'last', @@ -260,7 +260,7 @@ def sort( Parameters ---------- - keys : Sequence[str] | None + keys : str | list[str], optional Names of columns to sort by. If `None`, sort by all columns. ascending : Sequence[bool] or bool @@ -288,7 +288,7 @@ def sort( def sorted_indices( self, - keys: Sequence[str] | None = None, + keys: str | list[str] | None = None, *, ascending: Sequence[bool] | bool = True, nulls_position: Literal['first', 'last'] = 'last', @@ -300,7 +300,7 @@ def sorted_indices( Parameters ---------- - keys : Sequence[str] | None + keys : str | list[str], optional Names of columns to sort by. If `None`, sort by all columns. ascending : Sequence[bool] or bool @@ -793,10 +793,16 @@ def is_nan(self) -> DataFrame: """ ... - def unique_indices(self, keys: Sequence[str], *, skip_nulls: bool = True) -> Column[int]: + def unique_indices(self, keys: str | list[str] | None = None, *, skip_nulls: bool = True) -> Column[int]: """ Return indices corresponding to unique values across selected columns. + Parameters + ---------- + keys : str | list[str], optional + Column names to consider when finding unique values. + If `None`, all columns are considered. + Returns ------- Column[int]