我就废话不多说了,直接上代码吧!

【code】

import numpy as np
 
threshold=2
a=np.array([[1,2,3],[3,4,5]])
b=a>threshold
 
print("a="+str(a))
print("b="+str(b))

【result】

a=[[1 2 3]
 [3 4 5]]
b=[[False False True]
 [ True True True]]