map vs comprehension
This commit is contained in:
parent
b679d06b54
commit
75c1d183cb
4
ch04.jl
4
ch04.jl
@ -59,6 +59,10 @@ end
|
|||||||
[mean(col) for col in eachcol(aq)]
|
[mean(col) for col in eachcol(aq)]
|
||||||
[std(col) for col in eachcol(aq)]
|
[std(col) for col in eachcol(aq)]
|
||||||
|
|
||||||
|
x = (-2, -1, 0, 1, 2)
|
||||||
|
[abs(v) for v in x]
|
||||||
|
map(abs, x)
|
||||||
|
|
||||||
# Code for section 4.1.3
|
# Code for section 4.1.3
|
||||||
|
|
||||||
[mean(aq[:, j]) for j in axes(aq, 2)]
|
[mean(aq[:, j]) for j in axes(aq, 2)]
|
||||||
|
Loading…
Reference in New Issue
Block a user