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

Is it possible to compute stats grouped by a column? #231

Closed
xiaodaigh opened this issue Jul 14, 2021 · 2 comments
Closed

Is it possible to compute stats grouped by a column? #231

xiaodaigh opened this issue Jul 14, 2021 · 2 comments

Comments

@xiaodaigh
Copy link

The current GroupBy accepts a type. But is it possible to say, I have data coming in that is of the form (grp, x, y) And I wish to compute the same stats for x and y but I create a set of stats for each distinct value of grp?

Like a group by statement in SQL?

select
  mean(x),
  mean(y),
from
  data
group by
  grp;
@joshday
Copy link
Owner

joshday commented Jul 14, 2021

If I'm understanding correctly, you would use a Series as the stat in your GroupBy:

GroupBy(typeof(grp), Series(Mean(), Mean()))

Edit:

Note that this would expect an iterator with values like (grp, (x,y))

@joshday joshday closed this as completed Jul 14, 2021
@xiaodaigh
Copy link
Author

Ok. what if grp and x have the same type? Or something like that. Or I need to wrap grp in its own type.

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