在Python中通过threshold创建mask方式
时间:2021-03-22 09:10:58|栏目:Python代码|点击: 次
我就废话不多说了,直接上代码吧!
【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代码
下一篇:python实现决策树分类
本文标题:在Python中通过threshold创建mask方式
本文地址:http://www.codeinn.net/misctech/85996.html






