Numpy given two arrays with values and confidence create an array of highest confidence values

As @HansHirse mentioned in the comments:

np.where(probs1 > probs2, vals1, vals2)

which for each element, checks the condition and if it is True returns corresponding element of vals1, otherwise vals2.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top