diff --git a/protocol/dataframe_protocol.py b/protocol/dataframe_protocol.py index e918e1e4..e44f84a6 100644 --- a/protocol/dataframe_protocol.py +++ b/protocol/dataframe_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from abc import ( ABC, abstractmethod, @@ -476,6 +478,31 @@ def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame": """ pass + @abstractmethod + def slice_rows( + self, + start: int | None = None, + stop: int | None = None, + step: int | None = None, + ) -> DataFrame: + """ + Select a subset of rows corresponding to a slice. + + Parameters + ---------- + start : int or None + If None, starts at 0. + stop : int or None + If None, stops at the end. + step : int or None + If None, uses the default step of 1. + + Returns + ------- + DataFrame + """ + pass + @abstractmethod def get_chunks(self, n_chunks: Optional[int] = None) -> Iterable["DataFrame"]: """