import pandas as pd
dfs = pd.read_excel("工作表.xlsx", sheet_name=None, usecols=['列名'])
df = pd.concat(dfs)
list1 = []
for i in df["列名"]:
list1.append(eval(i))
list2 = []
for i in list1:
for j in i:
list2.append(j)
set_data = set(list2)
df_out = pd.DataFrame(set_data)
df_out.to_excel('去重.xlsx', index=False)
标签:set,df,list1,列表,pd,字符串,list2,append
From: https://www.cnblogs.com/tiansz/p/16832597.html