Skip to content

Commit fc46bfd

Browse files
committed
add slice_rows to interchange protocol
1 parent c5f0835 commit fc46bfd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

protocol/dataframe_protocol.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,31 @@ def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame":
476476
"""
477477
pass
478478

479+
@abstractmethod
480+
def slice_rows(
481+
self,
482+
start: int | None = None,
483+
stop: int | None = None,
484+
step: int | None = None,
485+
) -> "DataFrame":
486+
"""
487+
Select a subset of rows corresponding to a slice.
488+
489+
Parameters
490+
----------
491+
start : int or None
492+
If None, starts at 0.
493+
stop : int or None
494+
If None, stops at the end.
495+
step : int or None
496+
If None, uses the default step of 1.
497+
498+
Returns
499+
-------
500+
DataFrame
501+
"""
502+
pass
503+
479504
@abstractmethod
480505
def get_chunks(self, n_chunks: Optional[int] = None) -> Iterable["DataFrame"]:
481506
"""

0 commit comments

Comments
 (0)