ray.data.block.BlockAccessor.upsert_column#
- BlockAccessor.upsert_column(column_name: str, column_data: pyarrow.ChunkedArray | pyarrow.Array | pandas.Series) pyarrow.Table | pandas.DataFrame [source]#
Upserts a column into the block. If the column already exists, it will be replaced.
- Parameters:
column_name – The name of the column to upsert.
column_data – The data to upsert into the column. (Arrow Array/ChunkedArray for Arrow blocks, Series or array-like for Pandas blocks)
- Returns:
The updated block.