Skip to content

rename get_columns_by_name to select #245

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
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
6 changes: 3 additions & 3 deletions spec/API_specification/dataframe_api/dataframe_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def get_column_by_name(self, name: str, /) -> Column[Any]:
"""
...

def get_columns_by_name(self, names: Sequence[str], /) -> DataFrame:
def select(self, names: Sequence[str], /) -> DataFrame:
"""
Select multiple columns by name.

Expand Down Expand Up @@ -194,14 +194,14 @@ def insert_column(self, column: Column[Any]) -> DataFrame:
df = df.insert_column(new_column.rename('a_plus_1'))

If you need to insert the column at a different location, combine with
:meth:`get_columns_by_name`, e.g.:
:meth:`select`, e.g.:

.. code-block:: python

new_column = df.get_column_by_name('a') + 1
new_columns_names = ['a_plus_1'] + df.get_column_names()
df = df.insert_column(new_column.rename('a_plus_1'))
df = df.get_columns_by_name(new_column_names)
df = df.select(new_column_names)

Parameters
----------
Expand Down