Commit 6f099ed0 authored by Almouhannad's avatar Almouhannad

Use helpers

parent ac58b5ff
__pycache__/constants.cpython-311.pyc __pycache__/constants.cpython-311.pyc
data/bread_basket_preprocessed.csv data/bread_basket_preprocessed.csv
__pycache__/helpers.cpython-311.pyc
...@@ -12,4 +12,6 @@ ...@@ -12,4 +12,6 @@
> - **FP Growth** > - **FP Growth**
> 1. **Performance comparison between the two algorithms** > 1. **Performance comparison between the two algorithms**
> ***This project contains a python file `constants.ipynb` containing some fixed values used in `hw.ipynb`, refered as `CONSTANTS` class*** > ***This project contains a python file `constants.ipynb` containing some fixed values used in `hw1.ipynb`, refered as `CONSTANTS` class***
> ***This project contains a python file `helpers.ipynb` containing some helper functions used in `hw1.ipynb`, refered as `HELPERS` class***
\ No newline at end of file
import pandas as pd
class HELPERS:
def read_dataset_from_csv(path):
try:
data = pd.read_csv(path)
return data
except FileNotFoundError:
print(f"Error: The file at {path} was not found.")
except pd.errors.EmptyDataError:
print(f"Error: The file at {path} is empty.")
except pd.errors.ParserError:
print(f"Error: The file at {path} could not be parsed.")
except Exception as e:
print(f"An unexpected error occurred: {e}")
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment