ray.data.row.TableRow#

class ray.data.row.TableRow(row: Any)[source]#

Bases: collections.abc.Mapping

A dict-like row of a tabular Dataset.

This implements the dictionary mapping interface, but provides more efficient access with less data copying than converting Arrow Tables or Pandas DataFrames into per-row dicts. This class must be subclassed, with subclasses implementing __getitem__, __iter__, and __len__.

Concrete subclasses include ray.data._internal.arrow_block.ArrowRow and ray.data._internal.pandas_block.PandasRow.

PublicAPI: This API is stable across Ray releases.

Methods

__init__(row)

Construct a TableRow (internal API).

as_pydict()

Convert to a normal Python dict.

get(key[, default])

Retrieve the corresponding layout by the string key.

items()

keys()

values()