v923z/micropython-ulab

[BUG] IndexError: indices must be integers, slices, or Boolean lists

raghunila opened this issue · 2 comments

Describe the bug
built from main branch
Issue is while rearranging 2 dimensional array, giving below error
IndexError: indices must be integers, slices, or Boolean lists
but works good with python 3.2 and numpy package

from ulab import numpy as np
from time import sleep

res = []
for i in range(10):
    res.append(np.arange(10 * i, 10 * (i + 1)))
res = np.array(res,  dtype=np.uint8)
res1 = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 0],  dtype=np.uint8)
print(res)

print(res[:, res1])

print(ulab.__version__)

To Reproduce
run this python console with ulab build

Expected behavior
columns should re arrange.

Additional context

v923z commented

I don't see what the problem is. You're trying to index by an ndarray. The IndexError tells you that that is not an accepted type. Implementing all aspects of numpy indexing is highly non-trivial, consumes a lot of flash space, and RAM. For that reason, you can't do everything that you can do in numpy.