This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-18
Channels
- # beginners (13)
- # boot (2)
- # cider (5)
- # cljs-dev (47)
- # cljsrn (5)
- # clojure (34)
- # clojure-berlin (2)
- # clojure-russia (33)
- # clojure-serbia (10)
- # clojure-spec (24)
- # clojurebridge (1)
- # clojurescript (21)
- # code-reviews (8)
- # core-matrix (4)
- # datomic (11)
- # hoplon (1)
- # jobs (1)
- # leiningen (4)
- # lumo (4)
- # off-topic (12)
- # om (3)
- # parinfer (4)
- # pedestal (3)
- # proton (1)
- # reagent (3)
- # ring-swagger (2)
- # rum (2)
- # untangled (9)
- # vim (6)
I've been starting to experiment with core.matrix, and I've been using code like ((mat 2) 1)
to pull out individual values from a 2d matrix when needed. Just switched to vectorz-clj, and that no longer works; nor does nth. Is there some idiomatic way to pull a single value? (first (drop 1 (first (drop 2 mat))))
works, but that's kind of ugly. I couldn't find an example in the wiki of pulling out a single value...
The canonical way to get a scalar in c.m is mget
, which should work across impls. So, if your matrix is mat
, and you want the element at 2 1, (mget mat 2 1)
will do it.
@jsa-aerial thanks! Read through the API, but somehow overlooked mget
.