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

Window-function to select subset of the records #522

Open
dreadatour opened this issue Oct 19, 2024 · 1 comment
Open

Window-function to select subset of the records #522

dreadatour opened this issue Oct 19, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dreadatour
Copy link
Contributor

dreadatour commented Oct 19, 2024

In #515 we have window-functions implemented. However some common use cases still requires a lot of works, for example, selecting a subset of the records with N records in each class may looks like this:

window = func.window(partition_by="signal.class", order_by="sys.rand")
(
    dc.mutate(row_number=func.row_number().over(window))
    .filter(C("row_number") < 6)
    .select_except("row_number")
)

We need to implement an easier way to do this with some helper functions, may be.

See also this comment.

@dreadatour dreadatour added the enhancement New feature or request label Oct 19, 2024
@dreadatour dreadatour self-assigned this Oct 19, 2024
@shcheklein
Copy link
Member

I think IBIS has a range window parameter that help with that (?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants