alexa

Elements corresponding to indices in Python ?

Elements corresponding to indices in Python ?

First loop through Indices to get the row and column index i.e. i0 and i1 respectively and then get the value in A. Use this:

 output = np.array([[A[i0][i1]] for i0, i1 in Indices]) 

Output:

 array([[2.3],
   [1.4],
   [2.5]])

196 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online

Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry