import xlrd
#打开Excel文件读取数据('文件所在路径')
data = xlrd.open_workbook(r'aa.xlsx')
#根据sheet索引获取sheet内容
sheet = data.sheet_by_index(0)
#获取行数
sheet_nrows = sheet.nrows
# 创建存放这列数据的列表
list1 = []
# 从第三行开始读取数据
i = 2
while i < sheet_nrows:
    list1.append(sheet.cell(i,0).value)
    i +=1
new_list = list(set(list1))                # 去重
new_list.sort(key=list1.index)             # 去重后顺序不变
print(new_list )

 

相关文章:

  • 2021-08-11
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
猜你喜欢
  • 2021-08-09
  • 2021-08-04
  • 2021-11-23
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案