scicloj/tablecloth

3-arity of map-columns fails

Closed this issue · 2 comments

(-> (ds/->>dataset {:a [0 1]
                               :b [1 2]})
    (map-columns :y  (fn [x y] (+ x y))))

-> Exception

How am I supposed to use the 3-arity form of map-columns ?
No column selector can only mean all columns ,does it ?

If yes, an arity-2 map function should work

3-arity map-columns maps only one selected column. (map-columns ds :y f) is the same as (map-columns ds :y :y f).

For your case you should call (map-columns ds :y [:a :b] f)

Thanks for info. I guess we can close it.