Last active
August 5, 2019 17:36
-
-
Save BryanCutler/b58eea7112be62582cc99f432b6f9118 to your computer and use it in GitHub Desktop.
TensorFlow Arrow Blog Part 9 - Read and Process Directory
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
def read_and_process_dir(directory): | |
"""Read a directory of CSV files and yield processed Arrow batches.""" | |
for f in os.listdir(directory): | |
if f.endswith(".csv"): | |
filename = os.path.join(directory, f) | |
for batch in read_and_process(filename): | |
yield batch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment