-
Notifications
You must be signed in to change notification settings - Fork 81
Add medianBy and percentileBy to the groupBy grammar
#1878
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,10 +86,10 @@ internal interface PivotDocs { | |
| * `| `__`.`__[**`last`**][Pivot.last]` \[ `**`{ `**`rowCondition: `[`RowFilter`][RowFilter]**` } `**`]` | ||
| * | ||
| * {@include [Indent]} | ||
| * `| `__`.`__[**`medianBy`**][Pivot.medianBy]**` { `**`column: `[`RowExpression`][RowExpression]**` }`** | ||
| * `| `__`.`__[**`medianBy`**][Pivot.medianBy]**` { `**`rowExpression: `[`RowExpression`][RowExpression]**` }`** | ||
| * | ||
| * {@include [Indent]} | ||
| * `| `__`.`__[**`percentileBy`**][Pivot.percentileBy]**`(`**`percentile: `[`Double`][Double]**`) { `**`column: `[`RowExpression`][RowExpression]**` }`** | ||
| * `| `__`.`__[**`percentileBy`**][Pivot.percentileBy]**`(`**`percentile: `[`Double`][Double]**`) { `**`rowExpression: `[`RowExpression`][RowExpression]**` }`** | ||
| * | ||
| * {@include [Indent]} | ||
| * __`.`__[**`with`**][Pivot.with]**` { `**`rowExpression: `[`RowExpression`][RowExpression]**` }`** | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be on An overload on |
||
|
|
@@ -150,8 +150,8 @@ internal interface PivotDocs { | |
| * (optionally, the first or last one that satisfies a predicate) of each group; | ||
| * * [minBy][Pivot.minBy] / [maxBy][Pivot.maxBy] — take the row with the minimum or maximum value | ||
| * of the given [RowExpression] evaluated on rows within each group; | ||
| * * [medianBy][Pivot.medianBy] / [percentileBy][Pivot.percentileBy] — take the row with | ||
| * the median or a specific percentile value of the given [RowExpression] evaluated on rows within each group. | ||
| * * [medianBy][Pivot.medianBy] / [percentileBy][Pivot.percentileBy] — take the row at the position closest | ||
| * to the estimated median/percentile index of the [RowExpression]'s results calculated on rows within each group. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes! :) |
||
| * | ||
| * These functions return a [ReducedPivot], which can then be transformed into a new [DataFrame] | ||
| * containing a single combined row (either using the original reduced rows or their transformed versions) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -372,7 +372,7 @@ To perform a reducing operation, use the following functions: | |
| * [`minBy`](minBy.md) / [`maxBy`](maxBy.md) – to get from each group the row with the smallest / largest result | ||
| of the [`row expression`](DataRow.md#row-expressions) supplied to the function. | ||
|
|
||
| * [`medianBy`](median.md) / [`percentileBy`](percentile.md) – to get the row with the value closest to the estimated | ||
| * [`medianBy`](median.md) / [`percentileBy`](percentile.md) – to get the row at the position closest to the estimated | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Jolanrensen I think last time I incorrectly implemented what you meant. Does it sound better now? :)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes :) hopefully people do still understand it, haha. It's quite a difficult explanation, but so is the concept |
||
| median/percentile index of the [`row expression`](DataRow.md#row-expressions)'s results calculated on rows within each group. | ||
|
|
||
| These functions return an instance of `ReducedGroupBy`, which is a class serving as a transitional step | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the parameter be called like in the function declaration (
rowExpressioninstead ofcolumn)?