Skip to content

Side Source

Bases: Enum

Which rows of a Table a Preview shows.

Added in version 0.1.0

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=1, side=ndp.Side.END))
#     city   price
#     TEXT FLOAT64
# 2  Paris   150.0
sales.preview(ndp.Preview(count=2, side=ndp.Side.RANDOM, seed=42))
#     city   price
#     TEXT FLOAT64
# 0  Paris   120.0
# 2  Paris   150.0

Attributes

START = auto() Source

The first rows. Default value.

Added in version 0.1.0

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, side=ndp.Side.START))
#     city   price
#     TEXT FLOAT64
# 0  Paris   120.0
# 1   Lyon    80.0

END = auto() Source

The last rows.

Added in version 0.1.0

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, side=ndp.Side.END))
#     city   price
#     TEXT FLOAT64
# 1   Lyon    80.0
# 2  Paris   150.0

RANDOM = auto() Source

Rows drawn at random, shown in the order of the Table.

Added in version 0.1.0

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, side=ndp.Side.RANDOM, seed=42))
#     city   price
#     TEXT FLOAT64
# 0  Paris   120.0
# 2  Paris   150.0