<@U0HUJ25V1> just read your intro article on kotli...
# datascience
h
@thomasnield just read your intro article on kotlin-statistics. I whipped up some extensions on
BinModel
which allow this:
Copy code
val avgWbccByAgeRange = patients.binByInt(valueSelector = { it.age }, binSize = 10, rangeStart = 20)
                                .averageByInt { it.whiteBloodCellCount }
For comparison, the article uses:
Copy code
val avgWbccByAgeRange = patients.binByInt(
        valueSelector = { it.age },
        binSize = 10,
        rangeStart = 20,
        groupOp = { it.map { it.whiteBloodCellCount }.average() }
)
I'll put together a PR if you're interested.