Skip to content

Instantly share code, notes, and snippets.

@francoisdevlin
Created June 24, 2009 19:49
Show Gist options
  • Save francoisdevlin/135478 to your computer and use it in GitHub Desktop.
Save francoisdevlin/135478 to your computer and use it in GitHub Desktop.
(defn pivot
([data kf vf](pivot data kf vf +))
([data kf vf reduct-fn]
(apply merge-with reduct-fn
(map #(apply hash-map ((proj kf vf) %))
data))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment