tumourkit.utils.preprocessing.read_csv
- tumourkit.utils.preprocessing.read_csv(name: str, csv_dir: str) Tuple[ndarray, DataFrame]
Reads a CSV file from the specified directory and returns its contents as a Pandas DataFrame.
- Parameters:
name (str) – The name of the CSV file (without extension).
csv_dir (str) – The directory containing the CSV file.
- Returns:
A tuple containing the ID and label columns of the CSV file as NumPy arrays, and the entire DataFrame.
- Return type:
Tuple[np.ndarray, np.ndarray, pd.DataFrame] or None
This function reads a CSV file from the specified directory and returns its contents as a Pandas DataFrame. The function expects the CSV file to have a specific filename format: ‘<name>.class.csv’. If the function is unable to read the CSV file or encounters an error, it returns None.