Skip to content

Preview(count=5, side=Side.START, seed=None, columns=ShownColumns.ALL) Source

How many rows of a Table to show, which ones, and how its columns are shown, used by Table.preview.

Added in version 0.1.0

Parameters:

  • count (int, default: 5)

    The number of rows, 5 by default. A shorter Table shows all its rows.

  • side (Side, default: Side.START)

    The first rows, Side.START by default, the last rows, Side.END, or rows drawn at random, Side.RANDOM.

  • seed (int | None, default: None)

    The seed of the random draw, to show the same rows each time, other rows at each call when omitted. Only Side.RANDOM accepts it.

  • columns (ShownColumns, default: ShownColumns.ALL)

    ShownColumns.ALL by default to show every column, going on after a line break when they do not fit, or ShownColumns.COMPACT to replace those that do not fit by ....

Raises:

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Paris"])
prices = ndp.Array.from_list([120.0, 80.0, 150.0])
sales = ndp.Table.from_arrays({"city": cities, "price": prices})
sales.preview(ndp.Preview(count=2))
#     city   price
#     TEXT FLOAT64
# 0  Paris   120.0
# 1   Lyon    80.0