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

GroupBy.take() and other missing functions #686

Open
Jolanrensen opened this issue May 2, 2024 · 3 comments
Open

GroupBy.take() and other missing functions #686

Jolanrensen opened this issue May 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Jolanrensen
Copy link
Collaborator

Currently, we can't do:

groupedDf
    .take(10)
    .concat()

to only concatenate the values of the first 10 groups. Instead, we'll have to convert to a normal DF first and convert back:

groupedDf
    .toDataFrame().take(10).asGroupBy()
    .concat()

The only row-based function that's available is filter(GroupedRowFilter) which can allow you to write .filter { it.index() <= 10 } but seems a bit odd.

@Jolanrensen Jolanrensen added the enhancement New feature or request label May 2, 2024
@Jolanrensen
Copy link
Collaborator Author

Jolanrensen commented May 2, 2024

Other missing functions include size(), drop(), first() etc.
Maybe we could make it an AnyFrame or a DataColumn/BaseColumn<GroupedDataRow>

@Jolanrensen
Copy link
Collaborator Author

interestingly .filter {} runs on a GroupedRowFilter<T, G>, where T is the original DF type. This allows type-safe access to all key columns, but also to all non-key columns which don't exist in the GroupBy object, causing Exceptions... This might need a slight redesign.

@koperagen
Copy link
Collaborator

interestingly .filter {} runs on a GroupedRowFilter<T, G>, where T is the original DF type. This allows type-safe access to all key columns, but also to all non-key columns which don't exist in the GroupBy object, causing Exceptions... This might need a slight redesign.

#663

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