筛选 EXCEL

import xlrd
import xlwt
def readExcelFile(filename):
workbook = xlrd.open_workbook(filename=filename)# 打开 EXCEL 文件
sheet1 = workbook.sheet_by_index(0)
res_book = xlwt.Workbook()# 写入 EXCEL 文件
sheet2 = res_book.add_sheet(‘result’, cell_overwrite_ok=True)
for j in range(sheet1.ncols):# 遍历,读取打开文件列数,循环列数
max_row = len(sheet1.col_values(j))# 最大行数
duplacate = []# 空列表
data = []# 空列表
for v in range(max_row):# 遍历。循环最大行数
col_value = sheet1.col_values(j)[v]# 定位列、行数,单元格位置
if v == 0:# 如果单元格为 0
sheet2.write(v, j, col_value)# 写入单元格数据
if (col_value in duplacate) and (col_value not in data):
data.append(col_value)
duplacate.append(col_value)
for index in range(len(data)):
sheet2.write(index+1, j, data[index])

res_book.save(r'E:\程序\cs\cp-sjfx\66.xls')

readExcelFile(‘E:\ 程序 \cs\cp-sjfx\ 原始数据.xlsx’)

以上能筛重复数值,但是如何保留非重复数值。请帮忙修改下