import os
lis = []
filelist = os.listdir('./Flux') # 获取该目录下的所有文件名
for file in filelist:
path = file.split(".")
lis.append(path[0])
# 把文件名改成数字
int_list = [int(x) for x in lis]
int_list.sort() # 排序,为了后续的一一对应
print(int_list)
lis1 = []
for i in range(1, 2251):
lis1.append(i)
print(lis1)
lis2 = []
fast = 0
val = 1
while fast < len(int_list):
if int_list[fast] == val:
lis2.append(1) # 正常的赋为1
else:
lis2.append(0) # 缺失值赋为0
val += 1
fast += 1
print(lis2)
print(len(lis2))
print(lis2.index(0)) # 输出确实值的索引