I have an array and want to extract the element at index i.
The array is originally an numpy array and the index variable is an mx symbolic variable.
I first tried:
test_array = np.array([1,2,3,4])
index = MX(2)
return test_array[index]
-> This results in an error, which is due to some conflict with numpy>1.20.0
Then I tried:
test_array = np.array([1,2,3,4])
test_array_mx = MX(test_array)
index = MX(2)
return test_array_mx(index)
>> MX([1,2,3,4][2])
So both of those options do not work for accessing the 2nd element of the array. Is there a way to do so? Or is there a way to bring MX([1,2,3,4][2]) to MX(3)