Skip to content

API: Indexing #89

Closed
Closed
@jbrockmendel

Description

@jbrockmendel

Summarizing the discussion from the call 2022-10-13, the agreed-upon API looks like:

def get_column_by_name(self, key: str) -> Column: ...
def get_columns_by_name(self, keys: Sequence[str]) -> DataFrame: ...
def get_rows(self, indices: Punting[int]) -> DataFrame: ...
def slice_rows(self, start: int | None, stop: int | None, step: int | None) -> DataFrame: ...
def get_rows_by_mask(self, mask: Punting[bool]) -> DataFrame: ...

Punting[x] indicates that we discussed several options and decided to put off making a decision. For get_rows the options were Sequence[int] and Column[int]. For get_rows_by_mask the options were Arraylike[bool] and Column[bool] (here Arraylike probably denotes an object adhering to the array API standard, but some participants wanted to be stricter than that).

The following indexing methods from pandas.DataFrame are not included:

__getitem__
take
loc
iloc
at
iat
xs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions