fork download
  1. # your code goes here
  2. import numpy as np
  3. a = np.array([[0, 1, 2],[0, 2, 4],[0, 3, 6]])
  4. print(np.where(a < 4, a,)) # -1 is broadcast
  5. #array([[ 0, 1, 2],
  6. # [ 0, 2, -1],
  7. # [ 0, 3, -1]])
Runtime error #stdin #stdout #stderr 0.36s 35936KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 4, in <module>
ValueError: either both or neither of x and y should be given