Label Bins#
- group label_bins
Enums
Functions
-
std::unique_ptr<column> label_bins(column_view const &input, column_view const &left_edges, inclusive left_inclusive, column_view const &right_edges, inclusive right_inclusive, rmm::cuda_stream_view stream = cudf::get_default_stream(), rmm::mr::device_memory_resource *mr = rmm::mr::get_current_device_resource())#
Labels elements based on membership in the specified bins.
A bin
i
is defined byleft_edges[i], right_edges[i]
. Whether the edges are inclusive or not is determined byleft_inclusive
andright_inclusive
, respectively.A value
input[j]
belongs to bini
ifvalue[j]
is contained in the rangeleft_edges[i], right_edges[i]
(with the specified inclusiveness) andlabel[j] == i
. Ifinput[j]
does not belong to any bin, thenlabel[j]
is NULL.Notes:
If an empty set of edges is provided, all elements in
input
are labeled NULL.NULL elements in
input
belong to no bin and their corresponding label is NULL.NaN elements in
input
belong to no bin and their corresponding label is NULL.Bins must be provided in monotonically increasing order, otherwise behavior is undefined.
If two or more bins overlap, behavior is undefined.
- Throws:
cudf::logic_error – if
input.type() == left_edges.type() == right_edges.type()
is violated.cudf::logic_error – if
left_edges.size() != right_edges.size()
cudf::logic_error – if
left_edges.has_nulls()
orright_edges.has_nulls()
- Parameters:
input – The input elements to label according to the specified bins.
left_edges – Values of the left edge of each bin.
left_inclusive – Whether or not the left edge is inclusive.
right_edges – Value of the right edge of each bin.
right_inclusive – Whether or not the right edge is inclusive.
stream – CUDA stream used for device memory operations and kernel launches
mr – Device memory resource used to allocate the returned column’s device.
- Returns:
The integer labels of the elements in
input
according to the specified bins.
-
std::unique_ptr<column> label_bins(column_view const &input, column_view const &left_edges, inclusive left_inclusive, column_view const &right_edges, inclusive right_inclusive, rmm::cuda_stream_view stream = cudf::get_default_stream(), rmm::mr::device_memory_resource *mr = rmm::mr::get_current_device_resource())#