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

Define behavior when a Grouper's value is undefined or not present #5

Open
apmcleod opened this issue Jun 17, 2022 · 1 comment
Open

Comments

@apmcleod
Copy link

If an element cannot be grouped, instead of dropping it like here right now, we could also leave it in but with the old index. Or the behaviour could depend on a parameter similar to panda's .groupby(XY, dropna=False).

For example, let's say we're grouping by years but a couple of pieces don't have the year information in their metadata. Currently, those would "get lost" but we could give the choice to leave them in. The group name tuples would then have to be (previous_group, year), (previous_group, NaN). What do you think?

Originally posted by @johentsch in #1 (comment)

@apmcleod
Copy link
Author

I like your idea, of allowing to include a NaN (or something) in the index in those cases, via a parameter.

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

1 participant