Skip to content

Commit fe3ab0d

Browse files
committed
add DATA_FOLDER constant
1 parent 5e57143 commit fe3ab0d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mglearn/datasets.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import numpy as np
22
import pandas as pd
3+
import os
34
from scipy import signal
45
from sklearn.datasets import load_boston
56
from sklearn.preprocessing import MinMaxScaler, PolynomialFeatures
67
from .make_blobs import make_blobs
78

9+
DATA_FOLDER = os.path.join(os.path.dirname(__file__), "data")
10+
811

912
def make_forge():
1013
# a carefully hand-designed dataset lol
@@ -34,7 +37,7 @@ def load_extended_boston():
3437

3538

3639
def load_citibike():
37-
data_mine = pd.read_csv("data/citibike.csv")
40+
data_mine = pd.read_csv(os.path.join(DATA_FOLDER, "citibike.csv"))
3841
data_mine['one'] = 1
3942
data_mine['starttime'] = pd.to_datetime(data_mine.starttime)
4043
data_starttime = data_mine.set_index("starttime")

0 commit comments

Comments
 (0)