torchwrench.utils.data.dataset.tabular module

class torchwrench.utils.data.dataset.tabular.TabularDataset(data: Mapping[Any, SupportsGetitemIterLen] | SupportsGetitemIterLen[dict[Any, Any], Any] | DataFrame | Tensor | ndarray | DynamicItemDataset | TabularDatasetInterface[T_RowIndex, T_ColIndex], row_mapper: Mapping[T_RowIndex, T_RowIndex] | None = None, col_mapper: MutableMapping[T_ColIndex, T_ColIndex] | None = None, fns_list: Iterable[tuple[tuple[T_ColIndex, ...] | T_ColIndex, tuple[T_ColIndex, ...] | T_ColIndex, Callable]] = ())[source]

Bases: Generic[T_RowIndex, T_ColIndex], TabularDatasetInterface[T_RowIndex, T_ColIndex]

add_dynamic_column(fn: Callable, requires: tuple[T_ColIndex, ...], provides: T_ColIndex | tuple[T_ColIndex, ...], add_to_output_keys: bool = True) None[source]
property column_names : SupportsGetitemIterLen
classmethod from_csv(fpath: str | Path | TextIOBase, **kwds) Self[source]
classmethod from_json(fpath: str | Path | TextIOBase, **kwds) Self[source]
property row_names : SupportsGetitemIterLen
to_csv(fpath: str | Path, *args, **kwargs) None[source]
to_dataframe() DataFrame[source]
to_dict_list() dict[T_ColIndex, list][source]
to_json(fpath: str | Path, *args, **kwargs) None[source]
to_list_dict() list[dict[T_ColIndex, Any]][source]
to_numpy() ndarray[source]
to_tensor() Tensor[source]