Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEA] Python bindings for lists::segmented_gather #7465

Closed
shwina opened this issue Feb 26, 2021 · 1 comment · Fixed by #7591
Closed

[FEA] Python bindings for lists::segmented_gather #7465

shwina opened this issue Feb 26, 2021 · 1 comment · Fixed by #7591
Assignees
Labels
feature request New feature or request Python Affects Python cuDF API.

Comments

@shwina
Copy link
Contributor

shwina commented Feb 26, 2021

#7003 introduces lists::segmented_gather which we should plumb through to Python.

I'm not sure what the Python API should look like. For example we could have:

s = cudf.Series([[1, 2, 3], [3, 4, 5], [4, 5, 6]])
s.list.take([[0, 1], [2], [1, 2]])  # returns Series([[1, 2], [5], [5, 6]])

or alternatively:

s.list[[[0, 1], [2], [1,  2]]]

cc: @kkraus14 if you have a preferred API as this was requested by you in #6542 :)

@shwina shwina added feature request New feature or request Needs Triage Need team to review and classify labels Feb 26, 2021
@shwina shwina changed the title [FEA] [FEA] Python bindings for lists::segmented_gather Feb 26, 2021
@kkraus14
Copy link
Collaborator

I'm in preference of list.take personally. __getitem__ is too overloaded as it is.

@shwina shwina added Python Affects Python cuDF API. Cython and removed Needs Triage Need team to review and classify labels Feb 27, 2021
@isVoid isVoid self-assigned this Mar 12, 2021
rapids-bot bot pushed a commit that referenced this issue Mar 18, 2021
…7591)

Closes #7465 

Implements `ListColumn.list.take` based on `cudf::lists:segmented_gather`. Gather elements inside each list based on the provided positions. Example:

```python
>>> s = cudf.Series([[1, 2, 3], [4, 5]])
>>> s
0    [1, 2, 3]
1       [4, 5]
dtype: list
>>> s.list.take([[2, 1], [1, 0]])
0    [3, 2]
1    [5, 4]
dtype: list
```

Authors:
  - Michael Wang (@isVoid)

Approvers:
  - Keith Kraus (@kkraus14)

URL: #7591
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants