From eb33141195b82675b8d4ae3d48dd0cfe3eacbf3d Mon Sep 17 00:00:00 2001 From: "Mishra, Ritwik (PG/T - Comp Sci & Elec Eng)" <rm02120@surrey.ac.uk> Date: Tue, 22 Apr 2025 03:50:03 +0000 Subject: [PATCH] Delete utils.py - already existing in main --- src/utils.py | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 src/utils.py diff --git a/src/utils.py b/src/utils.py deleted file mode 100644 index 481a50f..0000000 --- a/src/utils.py +++ /dev/null @@ -1,30 +0,0 @@ -from pathlib import Path -import pandas as pd -import os - -def load_dataset(filename, folder="raw", base_path=None): - """ - Load a dataset from a specific folder path using pandas. - - Parameters: - filename (str): The name of the file (e.g., "data.csv"). - folder (str): The subfolder inside the data directory (default is "raw"). - base_path (str or Path): Base path to the data directory. If None, defaults to two levels up from this script. - - Returns: - pd.DataFrame: Loaded dataset. - """ - if base_path is None: - base_path = Path(__file__).resolve().parents[2] / "data" - - file_path = base_path / folder / filename - - if not file_path.exists(): - raise FileNotFoundError(f"⌠File not found: {file_path}") - - try: - df = pd.read_csv(file_path) - print(f"✅ Loaded dataset from: {file_path}") - return df - except Exception as e: - raise RuntimeError(f"âš ï¸ Failed to load dataset: {e}") -- GitLab