np.argwhere(np.isnan(x))判断数组/矩阵中Nan(或者inf)值的位置:

NoSuchKey