New answers tagged functional-style
8
votes
Accepted
Accumulate[] on an ordered HashTable
You could do something like this:
Module[{acc = 0}, Map[acc += # &, oht]]
(* <|a -> 1.224, b -> 2.32, c -> 4.206|> *)
but this will not be the ...
Top 50 recent answers are included
Related Tags
functional-style × 422list-manipulation × 103
function-construction × 91
functions × 65
performance-tuning × 36
programming × 36
map × 24
evaluation × 17
procedural-programming × 16
pure-function × 16
recursion × 15
code-review × 15
syntax × 13
core-language × 13
table × 12
replacement × 10
coding-style × 10
iteration × 9
pattern-matching × 8
dataset × 8
graphs-and-networks × 7
expression-manipulation × 7
associations × 7
plotting × 6
equation-solving × 6