主要有两种用法 1.np.where(condition, x, y)三目运算,满足条件输出x,否则y 2.np.where(condition)只有条件时,输出满足条件元素的下标。 3.np.where(matrix)输入矩阵,返回二维元组,分别是x和y的坐标。 Reference