arrow_feather_dataset: Creates a 'ArrowFeatherDataset'.

Description Usage Arguments Examples

View source: R/arrow_dataset.R

Description

An Arrow Dataset for reading record batches from Arrow feather files. Feather is a light-weight columnar format ideal for simple writing of Pandas DataFrames.

Usage

1
arrow_feather_dataset(filenames, columns, output_types, output_shapes = NULL)

Arguments

filenames

A tf.string tensor, list or scalar containing files in Arrow Feather format.

columns

A list of column indices to be used in the Dataset.

output_types

Tensor dtypes of the output tensors.

output_shapes

TensorShapes of the output tensors or NULL to infer partial.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
dataset <- arrow_feather_dataset(
    list('/path/to/a.feather', '/path/to/b.feather'),
    columns = reticulate::tuple(0L, 1L),
    output_types = reticulate::tuple(tf$int32, tf$float32),
    output_shapes = reticulate::tuple(list(), list())) %>%
  dataset_repeat(1)

sess <- tf$Session()
iterator <- make_iterator_one_shot(dataset)
next_batch <- iterator_get_next(iterator)

until_out_of_range({
  batch <- sess$run(next_batch)
  print(batch)
})

## End(Not run)

tfio documentation built on Dec. 25, 2019, 5:06 p.m.