py#查询特定值的索引


#建立一个测试数组a
a=np.array([[1,2,np.nan],[4,np.nan,6],[2,8,9]])

#查询特定值
np.where(a==2)

#查询nan值
np.where(np.isnan(a)==True)

相关