IDataMultipleReader#
- class anomalearn.reader.IDataMultipleReader.IDataMultipleReader#
Bases:
ABC
Interface for a dataset reader able to read multiple dataset at the same time.
List of decorated methods
get_all_dataframes
(*args, **kwargs)Gets all the dataframes previously read.
get_ith_dataframe
(pos, *args, **kwargs)Get the ith dataframe in all the read ones.
read_multiple
(paths[, files_format, ...])Reads multiple datasets at the same time.
Decorated methods
- abstract get_all_dataframes(*args, **kwargs) list[pandas.core.frame.DataFrame] #
Gets all the dataframes previously read.
- Parameters:
args – Not used, present to allow multiple inheritance and signature change.
kwargs – Not used, present to allow multiple inheritance and signature change.
- Returns:
dataframes – All the dataframes in the same order specified with read_multiple.
- Return type:
list[DataFrame]
- Raises:
ValueError – If the datasets have not been read.
- abstract get_ith_dataframe(pos: int, *args, **kwargs) DataFrame #
Get the ith dataframe in all the read ones.
- Parameters:
pos (int) – The position of the dataframe to be read.
args – Not used, present to allow multiple inheritance and signature change.
kwargs – Not used, present to allow multiple inheritance and signature change.
- Returns:
dataframe – The ith dataframe in the order specified with read_multiple.
- Return type:
DataFrame
- Raises:
IndexError – If the index is out of bounds.
ValueError – If the datasets have not been read.
- abstract read_multiple(paths: list[str], files_format: str = 'csv', pandas_args: dict | None = None, verbose: bool = True, *args, **kwargs) IDataMultipleReader #
Reads multiple datasets at the same time.
- Parameters:
paths (str) – It is a list of strings representing the paths at which the datasets to read are stored.
files_format (str, default="csv") – It is the format in which the datasets are stored.
pandas_args (dict or None) – This dict represent all the additional params to be used while reading the dataset with pandas. The params depend on the file format of the dataset. If the format is “csv”, the additional params will be the pandas params for read_csv and so on.
verbose (bool, default=True) – States if detailed printing must be done while reading the dataset.
args – Not used, present to allow multiple inheritance and signature change.
kwargs – Not used, present to allow multiple inheritance and signature change.
- Returns:
Instance of itself to be able to chain calls.
- Return type:
- Raises:
NotImplementedError – If the file format is not supported.