I have a list
index = [1, 1, 1, 0, 0]
and A is the array:
A = [[ 0. 5. 10. 15.]
[ 1. 6. 11. 16.]
[ 2. 7. 12. 17.]
[ 3. 8. 13. 18.]
[ 4. 9. 14. 19.]]
I basically want to create an array which appends the element of each row according to the index position in the list index. So to create the array [5, 6, 7, 3, 4]. I tried the following nested for loop but it obviously returned the 5 values for each row, rather than the specific one from each row.
list = []
for i in index:
for a in A:
list.append(a[i])
zipnp.arrays?