Skip to content

Commit

Permalink
rename get_rows to take (#339)
Browse files Browse the repository at this point in the history
* rename get_rows to gather

* rename to take instead
  • Loading branch information
MarcoGorelli authored Dec 8, 2023
1 parent f57f47a commit cf6eab6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spec/API_specification/dataframe_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,6 @@ def unique_indices(*columns: Column, skip_nulls: bool = True) -> Column:
If the original column(s) contain multiple `'NaN'` values, then
only a single index corresponding to those values will be returned.
Likewise for null values (if ``skip_nulls=False``).
To get the unique values, you can do ``df.get_rows(df.unique_indices(keys))``.
To get the unique values, you can do ``df.take(df.unique_indices(keys))``.
"""
...
4 changes: 2 additions & 2 deletions spec/API_specification/dataframe_api/column_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def dtype(self) -> DType:
"""Return data type of column."""
...

def get_rows(self, indices: Self) -> Self:
def take(self, indices: Self) -> Self:
"""Select a subset of rows, similar to `ndarray.take`.
Parameters
Expand Down Expand Up @@ -867,7 +867,7 @@ def unique_indices(self, *, skip_nulls: bool | Scalar = True) -> Self:
If the original Column contains multiple `'NaN'` values, then
only a single index corresponding to those values will be returned.
Likewise for null values (if ``skip_nulls=False``).
To get the unique values, you can do ``col.get_rows(col.unique_indices())``.
To get the unique values, you can do ``col.take(col.unique_indices())``.
"""
...

Expand Down
2 changes: 1 addition & 1 deletion spec/API_specification/dataframe_api/dataframe_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def select(self, *names: str) -> Self:
"""
...

def get_rows(self, indices: Column) -> Self:
def take(self, indices: Column) -> Self:
"""Select a subset of rows, similar to `ndarray.take`.
Parameters
Expand Down

0 comments on commit cf6eab6

Please sign in to comment.