holgerbrandl
01/20/2023, 11:02 PMirisData.groupBy("Species").summarizeAt({ all() }, SumFuns.mean)
. How could I rewrite this to use kotlin-dataframe instead? Essentially I want to summarize all columns in a grouped data-frame to their mean. Conceptually, one may even want to use different aggregators here to not compute mean but also standard deviation or other aggregates at once. (cc @Jolan Rensen [JB])Jolan Rensen [JB]
01/21/2023, 3:05 PMroman.belov
01/21/2023, 3:50 PMmean
and std
it looks like thisholgerbrandl
01/22/2023, 10:05 PMendsWith("Price")
and to provide a custom aggregation (as lambda)? Similar to the swiss-army-knife in dplyr across
https://dplyr.tidyverse.org/reference/across.htmlroman.belov
01/22/2023, 10:11 PMholgerbrandl
01/22/2023, 10:18 PMCannot find local variable 'this@AggregateGroupedDsl' with type org.jetbrains.kotlinx.dataframe.aggregation.AggregateGroupedDsl
As part of a program, it works fine.aggregate
@roman.belov. However, because the docs are presenting code only and do not include any data examples, I find it hard to understand/read (compared to the across
docs from above). Also, the grammar of aggregate does not indicate to me how and if (a) column selection and (b) custom aggregates are possible. Neither can I find any example how to do so. Are you sure it's possible? It's an edge use-case I believe, so not supporting it would be fine I guess, although clearly dplyr::across
emerged because there are obviously use-cases for a more flexible syntax.