08 2023 档案
用pandas把文件某一列转换成列表
摘要:import pandas as pdimport numpy as nppath = '产业布局-企业.xlsx'# 详情页链接title = pd.read_excel(path, usecols=[2])title_arr = np.asarray(title.stack()) # Dataf
删除文章里的中文符号和空格,换成英文逗号,并获取最后两个标签
摘要:def update_biaoqian(tag_list, title): if tag_list==[''] print('没有标签,取标题作为标签') titless = re.sub('\s', ',', title) tag_list = title.replace('、', ',').re
删除列表里的空格
摘要:def del_nt(title_list): title_new = [] for title_old in title_list: title = re.sub('\s', '', title_old) if title == '': pass else: title_new.append(ti