Skip to content

Rename get_rows_by_mask to filter #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/API_specification/dataframe_api/column_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def slice_rows(
...


def get_rows_by_mask(self: Column[DType], mask: Column[Bool]) -> Column[DType]:
def filter(self: Column[DType], mask: Column[Bool]) -> Column[DType]:
"""
Select a subset of rows corresponding to a mask.

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 @@ -161,7 +161,7 @@ def slice_rows(
"""
...

def get_rows_by_mask(self, mask: Column[Bool]) -> DataFrame:
def filter(self, mask: Column[Bool]) -> DataFrame:
"""
Select a subset of rows corresponding to a mask.

Expand Down
2 changes: 1 addition & 1 deletion spec/purpose_and_scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def my_dataframe_agnostic_function(df):
df = df.__dataframe_consortium_standard__(api_version='2023.08-beta')

mask = df.get_column_by_name('species') != 'setosa'
df = df.get_rows_by_mask(mask)
df = df.filter(mask)

for column_name in df.get_column_names():
if column_name == 'species':
Expand Down