scicloj / tablecloth

Dataset manipulation library built on the top of tech.ml.dataset
https://scicloj.github.io/tablecloth
MIT License
290 stars 25 forks source link

`tablecloth.api/percentiles` is not supposed to add a column #169

Open daslu opened 1 week ago

daslu commented 1 week ago

The following was reported by @lvh on a Slack thread: https://clojurians.slack.com/archives/C0BQDEJ8M/p1727016052908239

tablecloth.api/percentiles is currently expected to add a column to a dataset, but this does not make sense. https://github.com/scicloj/tablecloth/blob/1d501aa/src/tablecloth/api.clj#L1790

The percentiles computation indeed returns a collection of numbers, but the elements of that collection are simply the percentiles -- they do not correspond to the actual rows of the dataset, and thus they do not make sense as a new column.

genmeblog commented 1 week ago

It was (accidentally) added by a column project. Here is the full list, maybe it's good to review it again to avoid similar pitfalls. https://github.com/scicloj/tablecloth/blob/1d501aaeb1096f124b96955afd79f9242ef0781d/src/tablecloth/api/api_template.clj#L136

lvh commented 1 week ago

image