Add medianBy and percentileBy to the groupBy grammar#1878
Conversation
…s in `groupBy` and `pivot` KDocs and website docs
| * `| `__`.`__[**`percentileBy`**][Pivot.percentileBy]**`(`**`percentile: `[`Double`][Double]**`) { `**`rowExpression: `[`RowExpression`][RowExpression]**` }`** | ||
| * | ||
| * {@include [Indent]} | ||
| * __`.`__[**`with`**][Pivot.with]**` { `**`rowExpression: `[`RowExpression`][RowExpression]**` }`** |
There was a problem hiding this comment.
Should it be on ReducedPivot instead? If we mean the function for the second step of reducing: transform ReducedPivot into a DataRow.
An overload on Pivot also exists though, so I'm not completely sure.
| * | ||
| * {@include [Indent]} | ||
| * `| `__`.`__[**`medianBy`**][Pivot.medianBy]**` { `**`column: `[`RowExpression`][RowExpression]**` }`** | ||
| * `| `__`.`__[**`medianBy`**][Pivot.medianBy]**` { `**`rowExpression: `[`RowExpression`][RowExpression]**` }`** |
There was a problem hiding this comment.
Should the parameter be called like in the function declaration (rowExpression instead of column)?
| 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 |
There was a problem hiding this comment.
@Jolanrensen I think last time I incorrectly implemented what you meant. Does it sound better now? :)
There was a problem hiding this comment.
yes :) hopefully people do still understand it, haha. It's quite a difficult explanation, but so is the concept
| * ### Reduce [GroupBy] into [DataFrame] | ||
| * | ||
| * {@include [Indent]} | ||
| * [GroupBy][GroupBy]`.`[**`minBy`**][GroupBy.minBy]**` { `**`column: `[`ColumnSelector`][ColumnSelector]**` }`** |
There was a problem hiding this comment.
Shouldn't it be RowExpression instead of ColumnSelector? Same for maxBy below. If yes, I'll fix
There was a problem hiding this comment.
I think yes, I believe we confused minBy {} with minFor {}
| * * [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. |
Fixes #1785.
Adds
medianByandpercentileByto the Grammar ofgroupBy.Additionally, introduces a couple of minor fixes:
medianByandpercentileByin thegroupByandpivotKDocs and website docs;medianByandpercentileByin thepivotgrammar.