TableFrame.limit
methodView source ↗
def limit(n: int = 5) -> TableFrame
Categories: filters
Return a TableFrame with the first n rows.
This is equivalent to head.
Parameters
parameter
nThe number of rows to return.
Examples
>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
┌─────┬─────┐
│ a ┆ b │
│ --- ┆ --- │
│ str ┆ i64 │
╞═════╪═════╡
│ A ┆ 1 │
│ X ┆ 10 │
│ C ┆ 3 │
│ D ┆ 5 │
│ M ┆ 9 │
└─────┴─────┘
>>>
>>> tf.limit(2)
>>>
┌─────┬─────┐
│ a ┆ b │
│ --- ┆ --- │
│ str ┆ i64 │
╞═════╪═════╡
│ A ┆ 1 │
│ X ┆ 10 │
└─────┴─────┘