Spaces:
Sleeping
Sleeping
Download src/data_scripts/load_data.py from logan-codes/telco-churn-predictor: direct link, hf CLI and curl.
- Browser
- Download file 404 Bytes
-
https://huggingface.co/spaces/logan-codes/telco-churn-predictor/resolve/main/src/data_scripts/load_data.py
- Command line
-
hf download hf://spaces/logan-codes/telco-churn-predictor/src/data_scripts/load_data.py
-
curl -L -o load_data.py https://huggingface.co/spaces/logan-codes/telco-churn-predictor/resolve/main/src/data_scripts/load_data.py
404 Bytes
| import pandas as pd | |
| import os | |
| def load_data(file_path: str) -> pd.DataFrame: | |
| """ | |
| Loads CSV data into a pandas DataFrame. | |
| Args: | |
| file_path (str): Path to the CSV file. | |
| Returns: | |
| pd.DataFrame: Loaded dataset. | |
| """ | |
| if not os.path.exists(file_path): | |
| raise FileNotFoundError(f"File not found: {file_path}") | |
| return pd.read_csv(file_path) |