- 博客(1)
- 收藏
- 关注
原创 numpy中的np.where使用的小细节
numpy中的np.where使用的小细节import numpy as nplabel = np.array([[0,1,0,1,1],[1,1,0,1,1],[0,0,0,1,1]])pos_index = np.where(label[0] == 1)运行上面代码,返回的pos_index是一个包含array数组的元组,如下图所示:要先获得numpy类型数组,必须在pos_index后加索引:import numpy as nplabel = np.array([[0,1
2021-05-08 12:07:22 772
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人