Created
July 19, 2017 15:48
-
-
Save timehaven/3458d168b70eb2ede67c8db7bc057e5c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
while 1: | |
... | |
df = df.sample(frac=1) # shuffle all rows | |
... | |
i, j = 0, batch_size | |
for _ in range(nbatches): | |
sub = df.iloc[i:j] | |
idx = sub.index.values | |
X2 = bcolz.open(bcolz_dir)[idx] | |
... | |
# Calculate X and Y appropriately | |
... | |
yield [X, X2], Y | |
i = j | |
j += batch_size | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment