python 找到一个数组中没有出现的数字

python 找到一个数组中没有出现的数字

import numpy as np
def find_miss_number(the_array): # the_array是numpy array
    miss = []
    for i in range(np.max(the_array)):
        if i in the_array:
            i += 1
        else:
            miss.append(i + 1)
 
    return miss
发布了190 篇原创文章 · 获赞 65 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/qq_36607894/article/details/102952876