Skip to content

Commit

Permalink
FIX: wrong changes with importlib.resources use
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAuriau committed Mar 13, 2024
1 parent d94ac5a commit 7858087
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions choice_learn/datasets/expedia.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""ICDM 2013 Expedia dataset."""
import os
from pathlib import Path

import numpy as np
Expand All @@ -16,17 +15,15 @@ def load_expedia(as_frame=False, preprocessing="rumnet"):
"""Load the Expedia dataset."""
filename = "expedia.csv"
data_path = get_path(filename, module=DATA_MODULE)
if not Path.exists((data_path / filename)):
if not Path.exists(data_path):
print("In order to use the Expedia dataset, please download it from:")
print("https://www.kaggle.com/c/expedia-personalized-sort")
print("and save it in the following location:")
print(os.path.join(DATA_MODULE, filename))
print(data_path)
print("The downloaded train.csv file should be named 'expedia.csv'")
raise FileNotFoundError(
f"File {filename} not found in {os.path.join(DATA_MODULE, filename)}"
)
raise FileNotFoundError(f"File {filename} not found in {data_path}")

expedia_df = pd.read_csv((data_path / filename))
expedia_df = pd.read_csv(data_path)
if as_frame:
return expedia_df

Expand Down

0 comments on commit 7858087

Please sign in to comment.