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.