<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div>Hi, all</div><div><br></div><div>suppose:</div><div><br></div><div>- D, is the data matrix, its shape is  M x N</div><div>- I, is the indices matrix, its shape is M x K,  K<=N</div><div><br></div><div>Is there a efficient way to get a Matrix R with the same shape of I so that R[x,y] = D[x, I[x,y]] ?</div><div><br></div><div>A nested for-loop or list-comprehension is too slow for me.  </div><div><br></div><div>Thanks.</div><div class="ydp428314b9signature"><div style="font-size:16px;"><div><br></div><div>----<br></div><div>ZHUO QL (KDr2) <a href="http://kdr2.com" rel="nofollow" target="_blank">http://kdr2.com</a></div></div></div></div></div></body></html>