-
-
Save anonymous/0654ae82e81724b1ca2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; merge adjacents: sum values for in-/out-of-order, ditch extra cols and add sum-of-OOO values | |
(defn merge-set [xs] | |
(concat (vec (take 3 (first xs))) | |
(if (second xs) | |
[(sum-nths 4 xs) (sum-nths 4 (filter #(nth % 3) xs))] | |
[(nth (first xs) 4) 0]))) | |
(defn normalize-updated-labels [rows] | |
(->> rows | |
(map update-label-order) | |
(sort) | |
(partition-by (partial take 3)) | |
(map merge-set) | |
(concat))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment