Files | |
file | cudf/replace.hpp |
Enumerations | |
enum class | cudf::replace_policy : bool { PRECEDING , FOLLOWING } |
Policy to specify the position of replacement values relative to null rows. More... | |
Functions | |
std::unique_ptr< column > | cudf::replace_nulls (column_view const &input, column_view const &replacement, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
Replaces all null values in a column with corresponding values of another column. More... | |
std::unique_ptr< column > | cudf::replace_nulls (column_view const &input, scalar const &replacement, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
Replaces all null values in a column with a scalar. More... | |
std::unique_ptr< column > | cudf::replace_nulls (column_view const &input, replace_policy const &replace_policy, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
Replaces all null values in a column with the first non-null value that precedes/follows. More... | |
std::unique_ptr< column > | cudf::replace_nans (column_view const &input, column_view const &replacement, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
Replaces all NaN values in a column with corresponding values from another column. More... | |
std::unique_ptr< column > | cudf::replace_nans (column_view const &input, scalar const &replacement, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
Replaces all NaN values in a column with a scalar. More... | |
std::unique_ptr< column > | cudf::find_and_replace_all (column_view const &input_col, column_view const &values_to_replace, column_view const &replacement_values, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
Return a copy of input_col replacing any values_to_replace[i] found with replacement_values[i] . More... | |
std::unique_ptr< column > | cudf::clamp (column_view const &input, scalar const &lo, scalar const &lo_replace, scalar const &hi, scalar const &hi_replace, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
Replaces values less than lo in input with lo_replace , and values greater than hi with hi_replace . More... | |
std::unique_ptr< column > | cudf::clamp (column_view const &input, scalar const &lo, scalar const &hi, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
Replaces values less than lo in input with lo , and values greater than hi with hi . More... | |
std::unique_ptr< column > | cudf::normalize_nans_and_zeros (column_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
Copies from a column of floating-point elements and replaces -NaN and -0.0 with +NaN and +0.0 , respectively. More... | |
void | cudf::normalize_nans_and_zeros (mutable_column_view &in_out, rmm::cuda_stream_view stream=cudf::get_default_stream()) |
Modifies a column of floating-point elements to replace all -NaN and -0.0 with +NaN and +0.0 , respectively. More... | |
|
strong |
Policy to specify the position of replacement values relative to null rows.
PRECEDING
means the replacement value is the first non-null value preceding the null row. FOLLOWING
means the replacement value is the first non-null value following the null row.
Definition at line 41 of file cudf/replace.hpp.
std::unique_ptr<column> cudf::clamp | ( | column_view const & | input, |
scalar const & | lo, | ||
scalar const & | hi, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() |
||
) |
Replaces values less than lo
in input
with lo
, and values greater than hi
with hi
.
if lo
is invalid, then lo will not be considered while evaluating the input (Essentially considered minimum value of that type). if hi
is invalid, then hi will not be considered while evaluating the input (Essentially considered maximum value of that type).
cudf::logic_error | if lo.type() != hi.type() |
cudf::logic_error | if lo.type() != input.type() |
[in] | input | Column whose elements will be clamped |
[in] | lo | Minimum clamp value. All elements less than lo will be replaced by lo Ignored if null. |
[in] | hi | Maximum clamp value. All elements greater than hi will be replaced by hi Ignored if null. |
stream | CUDA stream used for device memory operations and kernel launches | |
[in] | mr | Device memory resource used to allocate device memory of the returned column |
lo
and hi
boundaries std::unique_ptr<column> cudf::clamp | ( | column_view const & | input, |
scalar const & | lo, | ||
scalar const & | lo_replace, | ||
scalar const & | hi, | ||
scalar const & | hi_replace, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() |
||
) |
Replaces values less than lo
in input
with lo_replace
, and values greater than hi
with hi_replace
.
if lo
is invalid, then lo will not be considered while evaluating the input (Essentially considered minimum value of that type). if hi
is invalid, then hi will not be considered while evaluating the input (Essentially considered maximum value of that type).
lo
is valid then lo_replace
should be valid If hi
is valid then hi_replace
should be validcudf::logic_error | if lo.type() != hi.type() |
cudf::logic_error | if lo_replace.type() != hi_replace.type() |
cudf::logic_error | if lo.type() != lo_replace.type() |
cudf::logic_error | if lo.type() != input.type() |
[in] | input | Column whose elements will be clamped |
[in] | lo | Minimum clamp value. All elements less than lo will be replaced by lo_replace Ignored if null. |
[in] | lo_replace | All elements less than lo will be replaced by lo_replace |
[in] | hi | Maximum clamp value. All elements greater than hi will be replaced by hi_replace . Ignored if null. |
[in] | hi_replace | All elements greater than hi will be replaced by hi_replace |
stream | CUDA stream used for device memory operations and kernel launches | |
[in] | mr | Device memory resource used to allocate device memory of the returned column |
lo
and hi
boundaries std::unique_ptr<column> cudf::find_and_replace_all | ( | column_view const & | input_col, |
column_view const & | values_to_replace, | ||
column_view const & | replacement_values, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() |
||
) |
Return a copy of input_col
replacing any values_to_replace[i]
found with replacement_values[i]
.
input_col | The column to find and replace values in |
values_to_replace | The values to replace |
replacement_values | The values to replace with |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device memory |
input_col
with specified values replaced std::unique_ptr<column> cudf::normalize_nans_and_zeros | ( | column_view const & | input, |
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() |
||
) |
Copies from a column of floating-point elements and replaces -NaN
and -0.0
with +NaN
and +0.0
, respectively.
Converts floating point values from input
using the following rules: Convert -NaN -> NaN Convert -0.0 -> 0.0
cudf::logic_error | if column does not have floating point data type. |
[in] | input | column_view of floating-point elements to copy and normalize |
stream | CUDA stream used for device memory operations and kernel launches | |
[in] | mr | device_memory_resource allocator for allocating output data |
void cudf::normalize_nans_and_zeros | ( | mutable_column_view & | in_out, |
rmm::cuda_stream_view | stream = cudf::get_default_stream() |
||
) |
Modifies a column of floating-point elements to replace all -NaN
and -0.0
with +NaN
and +0.0
, respectively.
Converts floating point values from in_out
using the following rules: Convert -NaN -> NaN Convert -0.0 -> 0.0
cudf::logic_error | if column does not have floating point data type. |
[in,out] | in_out | of floating-point elements to normalize |
stream | CUDA stream used for device memory operations and kernel launches |
std::unique_ptr<column> cudf::replace_nans | ( | column_view const & | input, |
column_view const & | replacement, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() |
||
) |
Replaces all NaN values in a column with corresponding values from another column.
If input[i]
is NaN, then output[i]
will contain replacement[i]
.
cudf::logic_error | If input and replacement are of different type or size. |
cudf::logic_error | If input or replacement are not of floating-point dtype. |
input | A column whose NaN values will be replaced |
replacement | A cudf::column whose values will replace NaN values in input |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device memory |
input
with the NaN values replaced with corresponding values from replacement
. std::unique_ptr<column> cudf::replace_nans | ( | column_view const & | input, |
scalar const & | replacement, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() |
||
) |
Replaces all NaN values in a column with a scalar.
If input[i]
is NaN, then output[i]
will contain replacement
.
cudf::logic_error | If input and replacement are of different type. |
cudf::logic_error | If input or replacement are not of floating-point dtype. |
input | A column whose NaN values will be replaced |
replacement | A cudf::scalar whose value will replace NaN values in input |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device memory |
input
with the NaN values replaced by replacement
std::unique_ptr<column> cudf::replace_nulls | ( | column_view const & | input, |
column_view const & | replacement, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() |
||
) |
Replaces all null values in a column with corresponding values of another column.
If input[i]
is NULL, then output[i]
will contain replacement[i]
. input
and replacement
must be of the same type and size.
[in] | input | A column whose null values will be replaced |
[in] | replacement | A cudf::column whose values will replace null values in input |
stream | CUDA stream used for device memory operations and kernel launches | |
[in] | mr | Device memory resource used to allocate device memory of the returned column |
input
with the null values replaced with corresponding values from replacement
. std::unique_ptr<column> cudf::replace_nulls | ( | column_view const & | input, |
replace_policy const & | replace_policy, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() |
||
) |
Replaces all null values in a column with the first non-null value that precedes/follows.
If input[i]
is NULL, then output[i]
will contain the first non-null value that precedes or follows the null value, based on replace_policy
.
[in] | input | A column whose null values will be replaced |
[in] | replace_policy | Specify the position of replacement values relative to null values |
stream | CUDA stream used for device memory operations and kernel launches | |
[in] | mr | Device memory resource used to allocate device memory of the returned column |
input
with null values replaced based on replace_policy
std::unique_ptr<column> cudf::replace_nulls | ( | column_view const & | input, |
scalar const & | replacement, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() |
||
) |
Replaces all null values in a column with a scalar.
If input[i]
is NULL, then output[i]
will contain replacement
. input
and replacement
must have the same type.
[in] | input | A column whose null values will be replaced |
[in] | replacement | Scalar used to replace null values in input |
stream | CUDA stream used for device memory operations and kernel launches | |
[in] | mr | Device memory resource used to allocate device memory of the returned column |
input
with null values replaced by replacement