Created
October 4, 2018 14:37
-
-
Save leechanwoo/ac33b2b7d0e25be0d368cf8250aae5e8 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
# python for loop | |
for d in Dataset: | |
d = preprocessing(d) | |
write_tfrecord(d) | |
# python map function | |
itr = map(preprocessing, Dataset) | |
for i in itr: | |
write_tfrecord(i) | |
# pyspark | |
rdd = sc.parallelize(Dataset) | |
.map(preprocessing) | |
.toLocalIterator() | |
for r in rdd: | |
write_tfrecord(r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment