Closed genmeblog closed 4 years ago
Something like:
(filter-by data dataset)
where the truthy indexes parts of data an index to keep. Then you could construct data via more efficient means than iterating through the dataset as a sequence of maps.
That alone (have data calculated efficiently) would close the gap a bit further between R and Clojure in the filter example previously on zulip.
Yes!
Addressed by: https://github.com/scicloj/tablecloth
There is an use case where we want to filter based on some column calculations. This calculations can't be done by simple
map
. For example: we need to filter by (moving) average, or Rrank
. To flow looks like that:Here is concrete case with
rank
: https://github.com/genmeblog/techtest/blob/master/src/techtest/datatable_dplyr.clj#L554I can think about solution of filter (
filter-by
maybe?) which takes a sequence and selects only rows corresponding to the result of predicate.