2017-10-17 5 views

Répondre

3

np.where est faite à cet effet

C = numpy.where(A > B, 1, 0) 
0

Pour ce cas précis, vous pouvez simplement faire

(A > B).astype(int) 

Comme booléens convertir en int comme 0 et 1