网络编程
位置:首页>> 网络编程>> Python编程>> 在Python中通过threshold创建mask方式

在Python中通过threshold创建mask方式

作者:hezhiyao  发布时间:2022-10-22 16:52:49 

标签: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]]

来源:https://www.cnblogs.com/hezhiyao/p/8433201.html

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com