Liking cljdoc? Tell your friends :D

thereisnodot.utils.collections

A set of useful collection manipulation functions

A set of useful collection manipulation functions
raw docstring

filter-map-keyclj

(filter-map-key filter-fn some-map)

Will filter on key of a hashmap

Will filter on key of a hashmap
sourceraw docstring

filter-map-valclj

(filter-map-val filter-fn some-map)

WIll filter on value of a hashmap

WIll filter on value of a hashmap
sourceraw docstring

hashmaps->sparse-tableclj

(hashmaps->sparse-table datum)
(hashmaps->sparse-table datum null-type)
(hashmaps->sparse-table datum null-type order-by)

Will turn a list of hashmaps into a sparse table. Useful when exporting data into a spreadsheet. First row is a headers row

Will turn a list of hashmaps into a sparse table. 
Useful when exporting data into a spreadsheet. 
First row is a headers row
sourceraw docstring

invert-mapclj

(invert-map dataset)

Turn values into keys and reverse. Basically, an inverted index. See tests for example

Turn values into keys and reverse. 
Basically, an inverted index. See tests for example
sourceraw docstring

jaccardclj

(jaccard a b)

Will calculate Jaccard distance over two sets

Will calculate Jaccard distance over two sets
sourceraw docstring

jaccard-wordsclj

(jaccard-words some-str some-another-str)

Calculate Jaccard distance between two strings split by space

Calculate Jaccard distance between two strings split by space
sourceraw docstring

map-longestclj

(map-longest fn & colls)

Opposite of map. On multiple collections will iterate until the longest sequence has no more members. Will hang when used with lazy collections

Opposite of map. On multiple collections will iterate until 
the longest sequence has no more members.
Will hang when used with lazy collections
sourceraw docstring

map-valclj

(map-val f m)

Will execute function over value of the map

Will execute function over value of the map
sourceraw docstring

meta-iterateclj

(meta-iterate data-set)

Provide metadata in the form {:index :last? :first?} on a collection

Provide metadata in the form {:index :last? :first?} on a collection
sourceraw docstring

nested-group-byclj

(nested-group-by fs coll & [final-fn])

From: https://stackoverflow.com/a/38842018/3362518 Like group-by but instead of a single function, this is given a list or vec of functions to apply recursively via group-by. An optional final argument (defaults to identity) may be given to run on the vector result of the final group-by. !!careful, deep nesting is not supported

From: https://stackoverflow.com/a/38842018/3362518
Like group-by but instead of a single function, this is given a list or vec
of functions to apply recursively via group-by. An optional `final` argument
(defaults to identity) may be given to run on the vector result of the final
group-by. !!careful, deep nesting is not supported
sourceraw docstring

order-by-collectionclj

(order-by-collection input order-coll)

Will order input hashmap by order collection. Will append non appearing at the end

Will order input hashmap by order collection. Will append 
non appearing at the end
sourceraw docstring

pad-collclj

(pad-coll n coll pad-with)

Pad collection <coll> with <pad-with> until <n> is reached

Pad collection <coll> with <pad-with> until <n> is reached
sourceraw docstring

pad-numbersclj

(pad-numbers n c pad-symbol)

Pad numbers - takes a number and the length to pad to as arguments

Pad numbers - takes a number and the length to pad to as arguments
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close