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

fix(pandas): fast methods support DataFrame aggs like n() #363

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

machow
Copy link
Owner

@machow machow commented Jan 5, 2022

Supports the use of aggregation calls like n(_) inside filter, that go GroupBy[DataFrame] -> GroupByAgg. Most operations take a GroupBy[Series], so I wrongly reached for the Series.name attribute.

from siuba.data import mtcars
from siuba import _
from siuba.dply.vector import n
from siuba.experimental.pd_groups import fast_filter

# raised error about DataFrame not having a name attribute
mtcars >> fast_filter(n(_) > 1)

# worked okay
mtcars >> fast_filter(n(_.mpg) > 1)

@machow machow merged commit 6bb551a into main Jan 6, 2022
@machow machow deleted the fix-fast-vector-n branch January 6, 2022 00:17
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

Successfully merging this pull request may close these issues.

1 participant