Created
November 11, 2018 14:28
-
-
Save tkazusa/3f2f0f6b0ce8286ccea2040c78950d96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load_train_data(): | |
paths = sorted(glob.glob('../data/train/*.csv.gz')) | |
with Pool() as p: | |
df = pd.concat(p.map(read_csv, paths), ignore_index=True, axis=0, copy=False) | |
logger.info('data size {}'.format(df.shape)) | |
return df | |
def load_val_data(): | |
paths = sorted(glob.glob('../data/val/*.csv.gz')) | |
with Pool() as p: | |
df = pd.concat(p.map(read_csv, paths), ignore_index=True, axis=0, copy=False) | |
logger.info('data size {}'.format(df.shape)) | |
return df | |
def load_test_data(): | |
paths = sorted(glob.glob('../data/test/*.csv.gz')) | |
with Pool() as p: | |
df = pd.concat(p.map(read_csv, paths), ignore_index=True, axis=0, copy=False) | |
logger.info('data size {}'.format(df.shape)) | |
return df | |
def load_all_data(): | |
paths = sorted(glob.glob('../data/*.csv.gz')) + \ | |
sorted(glob.glob('../data/*.csv.gz')) + sorted(glob.glob('../data/*.csv.gz')) | |
with Pool() as p: | |
df = pd.concat(p.map(read_csv, paths), ignore_index=True, axis=0, copy=False) | |
logger.info('data size {}'.format(df.shape)) | |
return df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment