cudf/replace.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2022, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cudf/types.hpp>
20 
22 
23 #include <memory>
24 
25 namespace cudf {
38 enum class replace_policy : bool { PRECEDING, FOLLOWING };
39 
53 std::unique_ptr<column> replace_nulls(
54  column_view const& input,
55  column_view const& replacement,
56  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
57 
70 std::unique_ptr<column> replace_nulls(
71  column_view const& input,
72  scalar const& replacement,
73  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
74 
87 std::unique_ptr<column> replace_nulls(
88  column_view const& input,
90  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
91 
113 std::unique_ptr<column> replace_nans(
114  column_view const& input,
115  column_view const& replacement,
116  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
117 
138 std::unique_ptr<column> replace_nans(
139  column_view const& input,
140  scalar const& replacement,
141  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
142 
154 std::unique_ptr<column> find_and_replace_all(
155  column_view const& input_col,
156  column_view const& values_to_replace,
157  column_view const& replacement_values,
158  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
159 
205 std::unique_ptr<column> clamp(
206  column_view const& input,
207  scalar const& lo,
208  scalar const& lo_replace,
209  scalar const& hi,
210  scalar const& hi_replace,
211  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
212 
251 std::unique_ptr<column> clamp(
252  column_view const& input,
253  scalar const& lo,
254  scalar const& hi,
255  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
256 
271 std::unique_ptr<column> normalize_nans_and_zeros(
272  column_view const& input,
273  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
274 
287  // end of group
289 } // namespace cudf
cudf::replace_nans
std::unique_ptr< column > replace_nans(column_view const &input, column_view const &replacement, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Replaces all NaN values in a column with corresponding values from another column.
per_device_resource.hpp
cudf::find_and_replace_all
std::unique_ptr< column > find_and_replace_all(column_view const &input_col, column_view const &values_to_replace, column_view const &replacement_values, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Return a copy of input_col replacing any values_to_replace[i] found with replacement_values[i].
cudf::replace_policy
replace_policy
Policy to specify the position of replacement values relative to null rows.
Definition: cudf/replace.hpp:38
cudf::column_view
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Definition: column_view.hpp:313
types.hpp
Type declarations for libcudf.
cudf::mutable_column_view
A non-owning, mutable view of device data as a column of elements, some of which may be null as indic...
Definition: column_view.hpp:477
cudf::scalar
An owning class to represent a singular value.
Definition: scalar.hpp:48
cudf::clamp
std::unique_ptr< column > clamp(column_view const &input, scalar const &lo, scalar const &lo_replace, scalar const &hi, scalar const &hi_replace, rmm::mr::device_memory_resource *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.
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::replace_nulls
std::unique_ptr< column > replace_nulls(column_view const &input, column_view const &replacement, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Replaces all null values in a column with corresponding values of another column.
rmm::mr::device_memory_resource
cudf::normalize_nans_and_zeros
std::unique_ptr< column > normalize_nans_and_zeros(column_view const &input, rmm::mr::device_memory_resource *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....