# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/modules/99_datasets.ipynb.

# %% auto #0
__all__ = ['load_nhs_attend', 'nhs_attend']

# %% ../nbs/modules/99_datasets.ipynb #f34c6c2b
from pathlib import Path
import pandas as pd
import peshbeen

def nhs_attend():
    # Find the root directory relative to the peshbeen package
    # This works whether running from /nbs or after installation
    base_path = Path(peshbeen.__file__).parent.parent
    file_path = base_path / 'data' / 'nhs_attend.xlsx'
    
    # Optional: Fallback for initial local development before 'pip install -e .'
    if not file_path.exists():
        file_path = Path('..') / 'data' / 'nhs_attend.xlsx'
        
    if not file_path.exists():
        raise FileNotFoundError(f"Could not find dataset at: {file_path}")
        
    return pd.read_excel(file_path)

#| export
load_nhs_attend = nhs_attend().set_index('date')
