Last active
August 5, 2019 17:38
-
-
Save BryanCutler/8d1532f212345720f9485ee475dc24f0 to your computer and use it in GitHub Desktop.
TensorFlow Arrow Blog Part 3 - ArrowFeatherDataset
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
import tensorflow_io.arrow as arrow_io | |
from pyarrow.feather import write_feather | |
# Write the Pandas DataFrame to a Feather file | |
write_feather(df, '/path/to/df.feather') | |
# Create the dataset with one or more filenames | |
ds = arrow_io.ArrowFeatherDataset( | |
['/path/to/df.feather'], | |
columns=(0, 1, 2), | |
output_types=(tf.int64, tf.float64, tf.float64), | |
output_shapes=([], [], [])) | |
# Iterate over each row of each file | |
for record in ds: | |
label, x0, x1 = record | |
# use label and feature tensors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment