Multi index array access

import numpy as np probs= np.array([[0.1, 0.2, 0.7],[0.2, 0.8, 0.6],[0.3, 0.6, 0.1]]) y = [2,1,1] print(probs[np.arange(len(probs)), y])
Accessing array values with multiplw indices

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.