lists#
- pylibcudf.lists.apply_boolean_mask(Column input, Column boolean_mask) Column #
Filters elements in each row of the input lists column using a boolean mask
For details, see
apply_boolean_mask()
.- Parameters:
- inputColumn
The input column.
- boolean_maskColumn
The boolean mask.
- Returns:
- Column
A Column of filtered elements based upon the boolean mask.
- pylibcudf.lists.concatenate_list_elements(Column input, bool dropna) Column #
Concatenate multiple lists on the same row into a single list.
For details, see
concatenate_list_elements()
.- Parameters:
- inputColumn
The input column
- dropnabool
If true, null list elements will be ignored from concatenation. Otherwise any input null values will result in the corresponding output row being set to null.
- Returns:
- Column
A new Column of concatenated list elements
- pylibcudf.lists.concatenate_rows(Table input) Column #
Concatenate multiple lists columns into a single lists column row-wise.
For details, see
concatenate_list_elements()
.- Parameters:
- inputTable
The input table
- Returns:
- Table
A new Column of concatenated rows
- pylibcudf.lists.contains(signatures, args, kwargs, defaults, _fused_sigindex={})#
Create a column of bool values indicating whether the search_key is contained in the input.
search_key
may be aColumn
or aScalar
.For details, see
contains()
.- Parameters:
- inputColumn
The input column.
- search_keyUnion[Column, Scalar]
The search key.
- Returns:
- Column
A new Column of bools indicating if the search_key was found in the list column.
- pylibcudf.lists.contains_nulls(Column input) Column #
Create a column of bool values indicating whether each row in the lists column contains a null value.
For details, see
contains_nulls()
.- Parameters:
- inputColumn
The input column.
- Returns:
- Column
A new Column of bools indicating if the list column contains a null value.
- pylibcudf.lists.count_elements(Column input) Column #
Count the number of rows in each list element in the given lists column. For details, see
count_elements()
.For details, see
count_elements()
.- Parameters:
- inputColumn
The input column
- Returns:
- Column
A new Column of the lengths of each list element
- pylibcudf.lists.difference_distinct(Column lhs, Column rhs, bool nulls_equal=True, bool nans_equal=True) Column #
Create a column of index values indicating the position of a search key row within the corresponding list row in the lists column.
For details, see
difference_distinct()
.- Parameters:
- lhsColumn
The input lists column of elements that may be included.
- rhsColumn
The input lists column of elements to exclude.
- nulls_equalbool, default True
If true, null elements are considered equal. Otherwise, unequal.
- nans_equalbool, default True
If true, libcudf will treat nan elements from {-nan, +nan} as equal. Otherwise, unequal. Otherwise, unequal.
- Returns:
- Column
A lists column containing the difference results.
- pylibcudf.lists.distinct(Column input, bool nulls_equal, bool nans_equal) Column #
Create a new list column without duplicate elements in each list.
For details, see
distinct()
.- Parameters:
- inputColumn
The input column.
- nulls_equalbool
If true, null elements are considered equal. Otherwise, unequal.
- nans_equalbool
If true, libcudf will treat nan elements from {-nan, +nan} as equal. Otherwise, unequal. Otherwise, unequal.
- Returns:
- Column
A new list column without duplicate elements in each list.
- pylibcudf.lists.explode_outer(Table input, size_type explode_column_idx) Table #
Explode a column of lists into rows.
All other columns will be duplicated for each element in the list.
For details, see
explode_outer()
.- Parameters:
- inputTable
The input table
- explode_column_idxint
The index of the column to explode
- Returns:
- Table
A new table with the exploded column
- pylibcudf.lists.extract_list_element(signatures, args, kwargs, defaults, _fused_sigindex={})#
Create a column of extracted list elements.
For details, see
extract_list_element()
.- Parameters:
- inputColumn
The input column.
- indexUnion[Column, size_type]
The selection index or indices.
- Returns:
- Column
A new Column with elements extracted.
- pylibcudf.lists.have_overlap(Column lhs, Column rhs, bool nulls_equal=True, bool nans_equal=True) Column #
Check if lists at each row of the given lists columns overlap.
For details, see
have_overlap()
.- Parameters:
- lhsColumn
The input lists column for one side.
- rhsColumn
The input lists column for the other side.
- nulls_equalbool, default True
If true, null elements are considered equal. Otherwise, unequal.
- nans_equalbool, default True
If true, libcudf will treat nan elements from {-nan, +nan} as equal. Otherwise, unequal. Otherwise, unequal.
- Returns:
- Column
A column containing the check results.
- pylibcudf.lists.index_of(signatures, args, kwargs, defaults, _fused_sigindex={})#
Create a column of index values indicating the position of a search key row within the corresponding list row in the lists column.
search_key
may be aColumn
or aScalar
.For details, see
index_of()
.- Parameters:
- inputColumn
The input column.
- search_keyUnion[Column, Scalar]
The search key.
- find_first_optionbool
If true, index_of returns the first match. Otherwise the last match is returned.
- Returns:
- Column
A new Column of index values that indicate where in the list column tthe search_key was found. An index value of -1 indicates that the search_key was not found.
- pylibcudf.lists.intersect_distinct(Column lhs, Column rhs, bool nulls_equal=True, bool nans_equal=True) Column #
Create a lists column of distinct elements common to two input lists columns.
For details, see
intersect_distinct()
.- Parameters:
- lhsColumn
The input lists column of elements that may be included.
- rhsColumn
The input lists column of elements to exclude.
- nulls_equalbool, default True
If true, null elements are considered equal. Otherwise, unequal.
- nans_equalbool, default True
If true, libcudf will treat nan elements from {-nan, +nan} as equal. Otherwise, unequal. Otherwise, unequal.
- Returns:
- Column
A lists column containing the intersection results.
- pylibcudf.lists.reverse(Column input) Column #
Reverse the element order within each list of the input column.
For details, see
reverse()
.- Parameters:
- inputColumn
The input column.
- Returns:
- Column
A new Column with reversed lists.
- pylibcudf.lists.segmented_gather(Column input, Column gather_map_list) Column #
Create a column with elements gathered based on the indices in gather_map_list
For details, see
segmented_gather()
.- Parameters:
- inputColumn
The input column.
- gather_map_listColumn
The indices of the lists column to gather.
- Returns:
- Column
A new Column with elements in list of rows gathered based on gather_map_list
- pylibcudf.lists.sequences(Column starts, Column sizes, Column steps=None) Column #
Create a lists column in which each row contains a sequence of values specified by a tuple of (start, step, size) parameters.
For details, see
sequences()
.- Parameters:
- startsColumn
First values in the result sequences.
- sizesColumn
Numbers of values in the result sequences.
- stepsOptional[Column]
Increment values for the result sequences.
- Returns:
- Column
The result column containing generated sequences.
- pylibcudf.lists.sort_lists(Column input, bool ascending, null_order na_position, bool stable=False) Column #
Sort the elements within a list in each row of a list column.
For details, see
sort_lists()
.- Parameters:
- inputColumn
The input column.
- ascendingbool
If true, the sort order is ascending. Otherwise, the sort order is descending.
- na_positionNullOrder
If na_position equals NullOrder.FIRST, then the null values in the output column are placed first. Otherwise, they are be placed after.
- stable: bool
If true
stable_sort_lists()
is used, Otherwise,sort_lists()
is used.
- Returns:
- Column
A new Column with elements in each list sorted.
- pylibcudf.lists.union_distinct(Column lhs, Column rhs, bool nulls_equal=True, bool nans_equal=True) Column #
Create a lists column of distinct elements found in either of two input lists columns.
For details, see
union_distinct()
.- Parameters:
- lhsColumn
The input lists column of elements that may be included.
- rhsColumn
The input lists column of elements to exclude.
- nulls_equalbool, default True
If true, null elements are considered equal. Otherwise, unequal.
- nans_equalbool, default True
If true, libcudf will treat nan elements from {-nan, +nan} as equal. Otherwise, unequal. Otherwise, unequal.
- Returns:
- Column
A lists column containing the union results.