# An array of functions with Numba

**URL:** https://numba.discourse.group/t/an-array-of-functions-with-numba/1306
**Category:** Community Support
**Created:** [April 19, 2022, 7:16am UTC](https://numba.discourse.group/t/an-array-of-functions-with-numba/1306 "2022-04-19T07:16:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![duynguyenms2011](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/duynguyenms2011/32/581_2.png) [@duynguyenms2011](https://numba.discourse.group/u/duynguyenms2011)
#### Post date: [April 19, 2022, 7:16am UTC](https://numba.discourse.group/t/an-array-of-functions-with-numba/1306/1 "2022-04-19T07:16:13Z")

</div>

Hi all, I have a general question. I would like to compile the following function:

```auto
def test1(t):
    return t+1

def test2(t):
    return t+2

fs_compiled = [nb.vectorize(f) for f in [test1,test2]]
@nb.njit()
def check_nb1(t):
    out = sum(
        [
            fs_compiled[x](t) for x in np.arange(2)
        ]  
    )
    return out

```

However, when I run the code (`check_nb1(10)`), it gives the following error: `Cannot type list element type <class 'numba.np.ufunc.dufunc.DUFunc'>`. Could anyone please help me? Thanks a lot!

> Blockquote
