# No support for array indexing from a reflected list

**URL:** <https://numba.discourse.group/t/no-support-for-array-indexing-from-a-reflected-list/1233>\
**Category:** Community Support\
**Created:** [March 7, 2022, 10:13pm UTC](https://numba.discourse.group/t/no-support-for-array-indexing-from-a-reflected-list/1233 "2022-03-07T22:13:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ma7555](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/ma7555/32/557_2.png) [@ma7555](https://numba.discourse.group/u/ma7555)\
**Post date:** [March 7, 2022, 10:13pm UTC](https://numba.discourse.group/t/no-support-for-array-indexing-from-a-reflected-list/1233/1 "2022-03-07T22:13:55Z")

</div>

```auto
@jit(nopython=True)
def index_arr(ixes, points):
  return points[ixes]
points = np.random.uniform(-1, 1, (2048, 3)).astype(np.float32)
index_arr([1, 2, 3], points)

```

returns:

```auto
TypeError: unsupported array index type reflected list(int64)<iv=None> in [reflected list(int64)<iv=None>]

```

Anyways around this other than casting the list as np.array?

The problem is I have a large dictionary with tuples as keys and lists of indices as values. I use this indicies to slice from a numpy array and create a new Typed Dict for passing into a numba jit function.

Unfrotunatelly, looping through this dictionary to get the needed slices takes a very long time since the dictionary is large so I wanted to do this inside the jit function but having a hard time achieving so.

Thanks guys

---

<div class="post-metadata">

**Author:** ![guilherme](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/guilherme/32/111_2.png) [@guilherme](https://numba.discourse.group/u/guilherme)\
**Post date:** [March 10, 2022, 8:55pm UTC](https://numba.discourse.group/t/no-support-for-array-indexing-from-a-reflected-list/1233/2 "2022-03-10T20:55:37Z")

</div>

Hi @ma7555,

Numba does not support indexing using a Python list (reflected list). To circumvent this issue, you can convert the list to a NumPy array:

```python
import numpy as np
from numba import njit

@njit
def index_arr(ixes, points):
    return points[ixes]

points = np.random.uniform(-1, 1, (2048, 3)).astype(np.float32)
print(index_arr(np.array([1, 2, 3]), points))

```
