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

Filtering groups by condition #270

Open
bkamins opened this issue Jul 17, 2021 · 5 comments
Open

Filtering groups by condition #270

bkamins opened this issue Jul 17, 2021 · 5 comments

Comments

@bkamins
Copy link
Member

bkamins commented Jul 17, 2021

In the past the following DataFrames.jl syntax was also supported in DataFramesMeta.jl:

filter(groupby(df, :id), x -> mean(x.col) > 10)

In general - maybe we should have @filter (instead of @rsubset) that is rowwise/pergroup, to match planned @rselect, @rcombine?

@pdeffebach
Copy link
Collaborator

pdeffebach commented Jul 20, 2021

I did not see this! I think gmail is filtering github notifications from this Repo.

No, I don't think we should have @filter instead of @rsubset. Since we can do @subset df @byrow ... we should also have @rsubset for symmetry and consistency with @rselect etc.

I think a @filter is a good idea, letting us filter by groups. If we allow @filter for a DataFrame it would definitely be redundant with @rsubset, but that isn't the end of the world. We have some redundancy with filter and subset(df, ... ByRow(...)...) as well.

@bkamins
Copy link
Member Author

bkamins commented Jul 20, 2021

I am OK with having both @filter and @rsubset

@pdeffebach
Copy link
Collaborator

Do we need filter for 1.0?

@bkamins
Copy link
Member Author

bkamins commented Aug 1, 2021

No, @filter is essential for filtering GroupedDataFrame groups only which is a quite rare use case I would say.
Also it can be added at any point later without breaking anything.

@pdeffebach
Copy link
Collaborator

This not a bad idea. Maybe @groupsubset is a better name, though.

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

No branches or pull requests

2 participants