polars.Config.set_tbl_rows#

classmethod Config.set_tbl_rows(n: int | None) type[Config][source]#

Set the max number of rows used to draw the table (both Dataframe and Series).

Parameters:
nint

Number of rows to display; if n < 0 (eg: -1), display all rows (DataFrame) and all elements (Series).

Examples

>>> df = pl.DataFrame(
...     {"abc": [1.0, 2.5, 3.5, 5.0], "xyz": [True, False, True, False]}
... )
>>> with pl.Config(tbl_rows=2):
...     print(df)
shape: (4, 2)
┌─────┬───────┐
│ abc ┆ xyz   │
│ --- ┆ ---   │
│ f64 ┆ bool  │
╞═════╪═══════╡
│ 1.0 ┆ true  │
│ …   ┆ …     │
│ 5.0 ┆ false │
└─────┴───────┘