Skip to content

Commit

Permalink
num_rows -> len of array
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Jul 11, 2024
1 parent a6d6896 commit f4a2d62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions narwhals/_arrow/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ def head(self, n: int) -> Self:
if n >= 0:
return self._from_native_series(ser.slice(0, n))
else:
num_rows = ser.num_rows
num_rows = len(ser)
return self._from_native_series(ser.slice(0, max(0, num_rows + n)))

def tail(self, n: int) -> Self:
ser = self._native_series
if n >= 0:
num_rows = ser.num_rows
num_rows = len(ser)
return self._from_native_series(ser.slice(max(0, num_rows - n)))
else:
return self._from_native_series(ser.slice(abs(n)))
Expand Down

0 comments on commit f4a2d62

Please sign in to comment.