specless.dataset.ArrayDataset

class specless.dataset.ArrayDataset(data: List[List[Any]] | ndarray, columns: List[str])[source]

Bases: BaseDataset

Dataset class that contains a list of data.

Methods

apply

Apply a function to each item in the data.

tolist

Convert the data to a list.

Attributes

length

Get the length of the data.

apply(func: Callable[[...], Any]) None

Apply a function to each item in the data.

Parameters:

func (Callable[..., Any]) – The function to apply to each item.

property length: int

Get the length of the data.

Returns:

The length of the data.

Return type:

int

tolist(key: str | None = None)

Convert the data to a list.

Parameters:

key (Optional[str], default=None) – The key to use to convert the data to a list. If None, all data is converted.

Returns:

The data converted to a list.

Return type:

list