Skip to content

Instantly share code, notes, and snippets.

@lildata
Last active January 12, 2017 19:43
Show Gist options
  • Save lildata/d0504d9cf4c2492e34ceb79189c750ab to your computer and use it in GitHub Desktop.
Save lildata/d0504d9cf4c2492e34ceb79189c750ab to your computer and use it in GitHub Desktop.
▤ tables & ℳ matrix
user=> (def m1 [{:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6} {:a 7 :c 9 :b 8 :d 10}])
#'user/m1
user=> (vec (for [m m1] ((juxt :a :b :c) m)))
[[1 2 3] [4 5 6] [7 8 9]]
user=> (pprint (vec (repeat 8 (vec (repeat 6 0)))))
[[0 0 0 0 0 0]
[0 0 0 0 0 0]
[0 0 0 0 0 0]
[0 0 0 0 0 0]
[0 0 0 0 0 0]
[0 0 0 0 0 0]
[0 0 0 0 0 0]
[0 0 0 0 0 0]]
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment