在在Python中通过中通过threshold创建创建mask方式方式
今天小编就为大家分享一篇在Python中通过threshold创建mask方式,具有很好的参考价值,希望对大家有所帮
助。一起跟随小编过来看看吧
我就废话不多说了,直接上代码吧!
【【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]]
以上这篇在Python中通过threshold创建mask方式就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多
多支持我们。
评论0
最新资源