gpytorchwrapper.src.data.data_reader

Functions

check_df_header(file)

Returns True if the file has a header and False if the file doesn't have one.

Classes

DataReader()

Class for reading data from either a pickle or csv file.

class gpytorchwrapper.src.data.data_reader.DataReader[source]

Bases: object

Class for reading data from either a pickle or csv file. The processed dataset must be a pandas DataFrame.

read_data(file: str | Path, file_type: str) DataFrame[source]
Parameters:
  • file (str or Path) – The path to the file to read.

  • file_type (str) – The type of file to read. Either ‘csv’ or ‘pickle’.

Returns:

The data read from the file

Return type:

pd.DataFrame

Raises:
  • ImportError – If the file is not of the file type specified.

  • NotImplementedError – If the file type specified is not implemented or the processed dataset in the pickle file is not a pandas DataFrame.

gpytorchwrapper.src.data.data_reader.check_df_header(file: str | Path) bool[source]

Returns True if the file has a header and False if the file doesn’t have one.

Parameters:

file (str or Path) – path to the file containing the data

Return type:

bool