thanks in advance for your help! I would like to the do the following, but I am new to Python, kind of unsure what to do efficiently.
- I have a 2d array, for example
A=[[1,1],[2,3]]. - Each value in the above 2d array corresponds to the index in another 1d array, for example:
B=[0.1,0.2,0.8,0.9]. - The end result should be like:
C=[[0.2,0.2],[0.8,0.9]]. That means,C[i,j]=B[index=A[i,j]].
The above is a simple example. But in practice, A can be a huge array, so I would really appreciate if there is any way to do this efficiently. Thank you!