ray.data.block.BlockAccessor#
- class ray.data.block.BlockAccessor[source]#
Provides accessor methods for a specific block.
Ideally, we wouldn’t need a separate accessor classes for blocks. However, this is needed if we want to support storing
pyarrow.Table
directly as a top-level Ray object, without a wrapping class (issue #17186).DeveloperAPI: This API may change across minor Ray releases.
Methods
Create an Arrow block from user-facing data formats.
Create a block from user-facing data formats.
Create a Pandas block from user-facing data formats.
Return the block type of this block.
Create a builder for this block type.
Returns a count of the distinct values in the provided column
Create a block accessor for the given block.
Create a metadata object from this block.
Iterate over the rows of this block.
Returns a max of the values in the provided column
Returns a mean of the values in the provided column
Return a sorted block by merging a list of sorted blocks.
Returns a min of the values in the provided column
Return the number of rows contained in this block.
Randomly shuffle this block.
Return the block reflecting the renamed columns.
Return a random sample of items from this block.
Return the Python type or pyarrow schema of this block.
Return a new block containing the provided columns.
Return the approximate size in bytes of this block.
Return a slice of this block.
Returns new block sorted according to provided
sort_key
Return a list of sorted partitions of this block.
Returns a sum of the values in the provided column
Returns a sum of diffs (from mean) squared for the provided column
Return a new block containing the provided row indices.
Convert this block into an Arrow table.
Convert this block into the provided batch format.
Return the base block that this accessor wraps.
Return the default data format for this accessor.
Convert this block (or columns of block) into a NumPy ndarray.
Convert this block into a Pandas dataframe.
Zip this block with another block of the same type and size.