I'd like to be able to transform an individual column in an incanter data set, and save the resulting data set to a new (csv) file. What is the simplest way to do that?
Essentially, I'd like to be able to map a function over a column in the data set, and replace the original column with this result.
You can define something like:
(defn map-data [dataset column fn]
(conj-cols (sel dataset :except-cols column)
($map fn column dataset)))
and use as
(def data (get-dataset :cars))
(map-data data :speed #(* % 2))
there is only one problem with changing of column names - I'll try to fix it, when I'll have free time...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With