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_scatter(signatures, args, kwargs, defaults, _fused_sigindex={})#

Scatter rows from input into target according to boolean_mask.

If source is a table, it specifies rows to scatter. If source is a list, each scalar is scattered into the corresponding column in the target_table.

For details on the implementation, see boolean_mask_scatter().

Parameters:
inputUnion[Table, List[Scalar]]

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:
Table

The result of the scatter

cudf._lib.pylibcudf.copying.copy_if_else(signatures, args, kwargs, defaults, _fused_sigindex={})#

Copy elements from lhs or rhs into a new column according to boolean_mask.

For details on the implementation, see copy_if_else().

Parameters:
lhsUnion[Column, Scalar]

The column or scalar to copy from if the corresponding element in boolean_mask is True.

rhsUnion[Column, 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_like(signatures, args, kwargs, defaults, _fused_sigindex={})#

Create an empty column or table with the same type as input.

For details, see empty_like().

Parameters:
inputUnion[Column, Table]

The column or table to use as a template for the output.

Returns:
Union[Column, Table]

An empty column or table with the same type(s) 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(signatures, args, kwargs, defaults, _fused_sigindex={})#

Scatter from source into target_table according to scatter_map.

If source is a table, it specifies rows to scatter. If source is a list, each scalar is scattered into the corresponding column in the target_table.

For details, see scatter().

Parameters:
sourceUnion[Table, List[Scalar]]

The table object or list of scalars 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:
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.slice(signatures, args, kwargs, defaults, _fused_sigindex={})#

Slice input according to indices.

For details on the implementation, see slice().

Parameters:
input_columnUnion[Column, Table]

The column or table to slice.

indicesList[int]

The indices to select from input.

Returns:
List[Union[Column, Table]]

The result of slicing input.

cudf._lib.pylibcudf.copying.split(signatures, args, kwargs, defaults, _fused_sigindex={})#

Split input into multiple.

For details on the implementation, see split().

Parameters:
inputUnion[Column, Table]

The column to split.

splitsList[int]

The indices at which to split the column.

Returns:
List[Union[Column, Table]]

The result of splitting input.