cudf.core.column.lists.ListMethods.take#
- ListMethods.take(lists_indices: Any) Union[Series, GenericIndex] #
Collect list elements based on given indices.
- Parameters
- lists_indices: Series-like of lists
Specifies what to collect from each row
- Returns
- Series or Index
Examples
>>> s = cudf.Series([[1, 2, 3], None, [4, 5]]) >>> s 0 [1, 2, 3] 1 None 2 [4, 5] dtype: list >>> s.list.take([[0, 1], [], []]) 0 [1, 2] 1 None 2 [] dtype: list