Ciaren

Limit rows

Limit rows — limitRows

Keep a slice of rows.

Use cases

  • Take the top N after a Sort (e.g. top 100 customers).
  • Page through data with offset + n.
  • Trim a preview to a manageable size.

What it does

Returns the first n rows from the current row order. Combine with Sort rows before limiting to get a meaningful "top N".

Before
regionamount
South150
West120
North80
East30
Central10
5 rows · 2 cols
Limit rows (n=3)
After
regionamount
South150
West120
North80
3 rows · 2 cols

Configuration

Config keyTypeRequiredDescription
nintYesNumber of rows to keep (≥ 0; 0 keeps no rows)
offsetintNoSkip this many rows first (default 0)

Generated Python code

df_2 = df_1.head(3)

Tips & common mistakes

  • Limit is positional, not random — sort first for a meaningful "top N". For a random subset use Sample rows.
  • offset skips from the current row order, so combine it with a deterministic Sort for stable paging.

See also