copying#
- cudf._lib.pylibcudf.copying.allocate_like(Column input_column, mask_allocation_policy policy, size=None) Column #
Allocate a column with the same type as input_column.
For details, see
allocate_like()
.- Parameters:
- input_columnColumn
The column to use as a template for the output.
- policymask_allocation_policy
Controls whether the output column has a valid mask.
- sizeint, optional
The number of elements to allocate in the output column. If not specified, the size of the input column is used.
- Returns:
- pylibcudf.Column
A column with the same type and size as input.
- cudf._lib.pylibcudf.copying.boolean_mask_scalars_scatter(list input, Table target, Column boolean_mask) Table #
Scatter scalars from input into target according to boolean_mask.
For details on the implementation, see
boolean_mask_scatter()
.- Parameters:
- inputList[Scalar]
A list of scalars to scatter into target.
- targetTable
The table object into which to scatter data.
- boolean_maskColumn
A mapping from rows in input to rows in target.
- Returns:
- pylibcudf.Table
The result of the scatter
- cudf._lib.pylibcudf.copying.boolean_mask_table_scatter(Table input, Table target, Column boolean_mask) Table #
Scatter rows from input into target according to boolean_mask.
For details on the implementation, see
boolean_mask_scatter()
.- Parameters:
- inputTable
The table object from which to pull data.
- targetTable
The table object into which to scatter data.
- boolean_maskColumn
A mapping from rows in input to rows in target.
- Returns:
- pylibcudf.Table
The result of the scatter
- cudf._lib.pylibcudf.copying.column_slice(Column input_column, list indices) list #
Slice input_column according to indices.
For details on the implementation, see
slice()
.- Parameters:
- input_columnColumn
The column to slice.
- indicesList[int]
The indices to select from input_column.
- Returns:
- List[pylibcudf.Column]
The result of slicing input_column.
- cudf._lib.pylibcudf.copying.column_split(Column input_column, list splits) list #
Split input_column into multiple columns.
For details on the implementation, see
split()
.- Parameters:
- input_columnColumn
The column to split.
- splitsList[int]
The indices at which to split the column.
- Returns:
- List[pylibcudf.Column]
The result of splitting input_column.
- cudf._lib.pylibcudf.copying.copy_if_else(lhs, rhs, Column boolean_mask) Column #
Copy elements from lhs or rhs into a new column according to boolean_mask.
For details on the implementation, see
copy_if_else()
.- Parameters:
- lhsColumn or Scalar
The column or scalar to copy from if the corresponding element in boolean_mask is True.
- rhsColumn or Scalar
The column or scalar to copy from if the corresponding element in boolean_mask is False.
- boolean_maskColumn
The boolean mask to use to select elements from lhs and rhs.
- Returns:
- pylibcudf.Column
The result of copying elements from lhs and rhs according to boolean_mask.
- cudf._lib.pylibcudf.copying.copy_range(Column input_column, Column target_column, size_type input_begin, size_type input_end, size_type target_begin) Column #
Copy a range of elements from input_column to target_column.
For details on the implementation, see
copy_range()
.- Parameters:
- input_columnColumn
The column from which to copy elements.
- target_columnColumn
The column into which to copy elements.
- input_beginint
The index of the first element in input_column to copy.
- input_endint
The index of the last element in input_column to copy.
- target_beginint
The index of the first element in target_column to overwrite.
- Returns:
- pylibcudf.Column
A copy of target_column with the specified range overwritten.
- cudf._lib.pylibcudf.copying.copy_range_in_place(Column input_column, Column target_column, size_type input_begin, size_type input_end, size_type target_begin) Column #
Copy a range of elements from input_column to target_column.
The target_column is overwritten in place.
For details on the implementation, see
copy_range_in_place()
.- Parameters:
- input_columnColumn
The column from which to copy elements.
- target_columnColumn
The column into which to copy elements.
- input_beginint
The index of the first element in input_column to copy.
- input_endint
The index of the last element in input_column to copy.
- target_beginint
The index of the first element in target_column to overwrite.
- cudf._lib.pylibcudf.copying.empty_column_like(Column input)#
Create an empty column with the same type as input.
For details, see
empty_like()
.- Parameters:
- inputColumn
The column to use as a template for the output.
- Returns:
- pylibcudf.Column
An empty column with the same type as input.
- cudf._lib.pylibcudf.copying.empty_table_like(Table input)#
Create an empty table with the same type as input.
For details, see
empty_like()
.- Parameters:
- inputTable
The table to use as a template for the output.
- Returns:
- pylibcudf.Table
An empty table with the same type as input.
- cudf._lib.pylibcudf.copying.gather(Table source_table, Column gather_map, out_of_bounds_policy bounds_policy) Table #
Select rows from source_table according to the provided gather_map.
For details, see
gather()
.- Parameters:
- source_tableTable
The table object from which to pull data.
- gather_mapColumn
The list of row indices to pull out of the source table.
- bounds_policyout_of_bounds_policy
Controls whether out of bounds indices are checked and nullified in the output or if indices are assumed to be in bounds.
- Returns:
- pylibcudf.Table
The result of the gather
- cudf._lib.pylibcudf.copying.get_element(Column input_column, size_type index) Scalar #
Get the element at index from input_column.
For details on the implementation, see
get_element()
.- Parameters:
- input_columnColumn
The column from which to get the element.
- indexint
The index of the element to get.
- Returns:
- pylibcudf.Scalar
The element at index from input_column.
- cudf._lib.pylibcudf.copying.scatter_scalars(list source, Column scatter_map, Table target_table) Table #
Scatter scalars from source into target_table according to scatter_map.
For details, see
scatter()
.- Parameters:
- sourceList[Scalar]
A list of scalars to scatter into target_table.
- scatter_mapColumn
A mapping from rows in source to rows in target_table.
- target_tableTable
The table object into which to scatter data.
- Returns:
- pylibcudf.Table
The result of the scatter
- cudf._lib.pylibcudf.copying.scatter_table(Table source, Column scatter_map, Table target_table) Table #
Scatter rows from source into target_table according to scatter_map.
For details, see
scatter()
.- Parameters:
- sourceTable
The table object from which to pull data.
- scatter_mapColumn
A mapping from rows in source to rows in target_table.
- target_tableTable
The table object into which to scatter data.
- Returns:
- pylibcudf.Table
The result of the scatter
- cudf._lib.pylibcudf.copying.shift(Column input, size_type offset, Scalar fill_values) Column #
Shift the elements of input by offset.
For details on the implementation, see
shift()
.- Parameters:
- inputColumn
The column to shift.
- offsetint
The number of elements to shift by.
- fill_valuesScalar
The value to use for elements that are shifted in from outside the bounds of the input column.
- Returns:
- pylibcudf.Column
A copy of input shifted by offset.
- cudf._lib.pylibcudf.copying.table_slice(Table input_table, list indices) list #
Slice input_table according to indices.
For details on the implementation, see
slice()
.- Parameters:
- input_tableTable
The table to slice.
- indicesList[int]
The indices to select from input_table.
- Returns:
- List[pylibcudf.Table]
The result of slicing input_table.
- cudf._lib.pylibcudf.copying.table_split(Table input_table, list splits) list #
Split input_table into multiple tables.
For details on the implementation, see
split()
.- Parameters:
- input_tableTable
The table to split.
- splitsList[int]
The indices at which to split the table.
- Returns:
- List[pylibcudf.Table]
The result of splitting input_table.