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) -
seed(int | None, default:None) -
columns(ShownColumns, default:ShownColumns.ALL)ShownColumns.ALLby default to show every column, going on after a line break when they do not fit, orShownColumns.COMPACTto replace those that do not fit by....
Raises:
-
InvalidTypeErrorWhen a setting is not of the type its annotation names.
-
InvalidCountErrorWhen
countis lower than 1. -
InvalidSeedErrorWhen
seedis negative. -
RefusedSettingError
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