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

Support More Aggregate Methods #265

Merged
merged 16 commits into from
Sep 25, 2019
Merged

Support More Aggregate Methods #265

merged 16 commits into from
Sep 25, 2019

Conversation

elvaliuliuliu
Copy link
Contributor

This PR exposes more aggregate methods for RelationalGroupedDataset like Mean(), Max(), Avg(), Min(). Follow up on issue #260

suhsteve
suhsteve previously approved these changes Sep 25, 2019
Copy link
Member

@suhsteve suhsteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

imback82
imback82 previously approved these changes Sep 25, 2019
Copy link
Contributor

@imback82 imback82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -404,6 +404,22 @@ public void TestSignaturesV2_3_X()
Assert.IsType<RelationalGroupedDataset>(_df.GroupBy(_df["age"]));
Assert.IsType<RelationalGroupedDataset>(_df.GroupBy(_df["age"], _df["name"]));

Assert.IsType<DataFrame>(_df.GroupBy("name").Mean("age"));
Assert.IsType<DataFrame>(
_df.WithColumn("tempAge", _df["age"]).GroupBy("name").Mean("age", "tempAge"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for these GroupBy.fn tests, let's pull out _df.WithColumn("tempAge", _df["age"]).GroupBy("name") into a var within it's own scope, { ... } and reuse.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with _df.GroupBy("name") as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the changes. Please let me know if the var name makes sense. Thanks!

@elvaliuliuliu elvaliuliuliu dismissed stale reviews from imback82 and suhsteve via 520ba68 September 25, 2019 19:42
Assert.IsType<DataFrame>(_df.GroupBy("name").Sum("age"));
Assert.IsType<DataFrame>(
_df.WithColumn("tempAge", _df["age"]).GroupBy("name").Sum("age", "tempAge"));
var relationalGroupedDataset = _df.GroupBy("name");
Copy link
Member

@suhsteve suhsteve Sep 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's enclose this whole subsection with a { }. We can shorten the variable names. Just using df1 and df2 should suffice. Also use RelationalGroupedDataset instead of var

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! Done

@imback82 imback82 added the enhancement New feature or request label Sep 25, 2019
Copy link
Member

@suhsteve suhsteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@imback82 imback82 merged commit 131d9b1 into dotnet:master Sep 25, 2019
@elvaliuliuliu elvaliuliuliu deleted the elva/aggregateMethods branch September 25, 2019 23:15
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

Successfully merging this pull request may close these issues.

3 participants