待处理数据如下,含有两个‘—’
del_index=[]
for i in range(data.shape[0]):
if data.iloc[i,:].isin(['—']).any():#每一行有任何一个单元格有'—'的话
del_index.append(i)
data.drop(del_index,inplace=True)
data.to_excel(os.getcwd()+'/temp/2-2.xlsx')#保存文件
待处理数据如下,含有两个‘—’
del_index=[]
for i in range(data.shape[0]):
if data.iloc[i,:].isin(['—']).any():#每一行有任何一个单元格有'—'的话
del_index.append(i)
data.drop(del_index,inplace=True)
data.to_excel(os.getcwd()+'/temp/2-2.xlsx')#保存文件