From be4155288cb0cbc180b6c5742b7f34a60d6bc4c4 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:15:57 +0000 Subject: [PATCH 1/2] rename get_rows to gather --- spec/API_specification/dataframe_api/__init__.py | 2 +- spec/API_specification/dataframe_api/column_object.py | 4 ++-- spec/API_specification/dataframe_api/dataframe_object.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/API_specification/dataframe_api/__init__.py b/spec/API_specification/dataframe_api/__init__.py index fa910759..e72e5e13 100644 --- a/spec/API_specification/dataframe_api/__init__.py +++ b/spec/API_specification/dataframe_api/__init__.py @@ -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.gather(df.unique_indices(keys))``. """ ... diff --git a/spec/API_specification/dataframe_api/column_object.py b/spec/API_specification/dataframe_api/column_object.py index b3e10738..5d42f15c 100644 --- a/spec/API_specification/dataframe_api/column_object.py +++ b/spec/API_specification/dataframe_api/column_object.py @@ -110,7 +110,7 @@ def dtype(self) -> DType: """Return data type of column.""" ... - def get_rows(self, indices: Self) -> Self: + def gather(self, indices: Self) -> Self: """Select a subset of rows, similar to `ndarray.take`. Parameters @@ -856,7 +856,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.gather(col.unique_indices())``. """ ... diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 4e423fd2..9c9f8a5a 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -132,7 +132,7 @@ def select(self, *names: str) -> Self: """ ... - def get_rows(self, indices: Column) -> Self: + def gather(self, indices: Column) -> Self: """Select a subset of rows, similar to `ndarray.take`. Parameters From bc31ab9b7a682eb742ab10a085d5d782c5200f5f Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Fri, 8 Dec 2023 11:16:05 +0000 Subject: [PATCH 2/2] rename to take instead --- spec/API_specification/dataframe_api/__init__.py | 2 +- spec/API_specification/dataframe_api/column_object.py | 4 ++-- spec/API_specification/dataframe_api/dataframe_object.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/API_specification/dataframe_api/__init__.py b/spec/API_specification/dataframe_api/__init__.py index e72e5e13..973a3478 100644 --- a/spec/API_specification/dataframe_api/__init__.py +++ b/spec/API_specification/dataframe_api/__init__.py @@ -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.gather(df.unique_indices(keys))``. + To get the unique values, you can do ``df.take(df.unique_indices(keys))``. """ ... diff --git a/spec/API_specification/dataframe_api/column_object.py b/spec/API_specification/dataframe_api/column_object.py index 5d42f15c..38696f32 100644 --- a/spec/API_specification/dataframe_api/column_object.py +++ b/spec/API_specification/dataframe_api/column_object.py @@ -110,7 +110,7 @@ def dtype(self) -> DType: """Return data type of column.""" ... - def gather(self, indices: Self) -> Self: + def take(self, indices: Self) -> Self: """Select a subset of rows, similar to `ndarray.take`. Parameters @@ -856,7 +856,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.gather(col.unique_indices())``. + To get the unique values, you can do ``col.take(col.unique_indices())``. """ ... diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 9c9f8a5a..27373bc6 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -132,7 +132,7 @@ def select(self, *names: str) -> Self: """ ... - def gather(self, indices: Column) -> Self: + def take(self, indices: Column) -> Self: """Select a subset of rows, similar to `ndarray.take`. Parameters