# Apply function array over data array

**URL:** <https://discourse.julialang.org/t/apply-function-array-over-data-array/7468>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [December 3, 2017, 5:03am UTC](https://discourse.julialang.org/t/apply-function-array-over-data-array/7468 "2017-12-03T05:03:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [December 3, 2017, 5:03am UTC](https://discourse.julialang.org/t/apply-function-array-over-data-array/7468/1 "2017-12-03T05:03:11Z")

</div>

I have an array of functions and an array of numerical data. I’d like to just apply the functions over the data and return the results in an array. I ended up creating a helper function and use the dot-notation to run them all… it works but it just seems a bit awkward. Perhaps there’s a simpler way?

```julia
julia> x = [1,2,3]
3-element Array{Int64,1}:
 1
 2
 3

julia> f = [x -> x, x -> x^2, x -> x^3]
3-element Array{Function,1}:
 #5
 #6
 #7

julia> g(f, x) = f(x)
g (generic function with 1 method)

julia> g.(f, x)
3-element Array{Int64,1}:
  1
  4
 27

```

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [December 3, 2017, 5:24am UTC](https://discourse.julialang.org/t/apply-function-array-over-data-array/7468/2 "2017-12-03T05:24:53Z")

</div>

`map.(f,x)`
