tf_quant_finance.experimental.io.ArrayDictReader

Contents

Last updated: 2023-03-16.

tf_quant_finance.experimental.io.ArrayDictReader#

View source

Iterator over the data serialized by ArrayDictWriter.

tf_quant_finance.experimental.io.ArrayDictReader(
    path
)

The reader counterpart of the ArrayDictWriter. It deserializes the binary tfrecords files written by the writer.

Provides an iterable interface.

Example#

  filename = '...'
  reader = ArrayDictReader(filename)
  # Read one record.
  first_record = next(reader)
  for record in reader:
    print(record)  # Print the rest of the records.

Methods#

__iter__

View source

__iter__()

next

View source

next()

Returns the next record if there is one or raises StopIteration.