Commit e9bce7fd authored by rico.liu's avatar rico.liu

update

parent 2eefae34
...@@ -54,13 +54,15 @@ def duplicate_product_update(filepath,category,sheet_name=0): ...@@ -54,13 +54,15 @@ def duplicate_product_update(filepath,category,sheet_name=0):
brand_id_list=[] brand_id_list=[]
for brand_id_tuple in brand_id_fetch: for brand_id_tuple in brand_id_fetch:
brand_id_list.append(brand_id_tuple[0]) brand_id_list.append(brand_id_tuple[0])
# existed_brand_list = []
existed_brand_list = [] # for brand_id in brand_id_list:
for brand_id in brand_id_list: # cursor_zi_new.execute(f"select name from p_brand where id={brand_id}")
cursor_zi_new.execute(f"select name from p_brand where id={brand_id}") # existed_brand_name = cursor_zi_new.fetchone()
existed_brand_name = cursor_zi_new.fetchone() # if existed_brand_name:
if existed_brand_name: # existed_brand_list.append(existed_brand_name[0])
existed_brand_list.append(existed_brand_name[0]) brand_id_tuple = tuple(brand_id_list)
cursor_zi_new.execute(f"select name from p_brand where id in {brand_id_tuple}")
existed_brand_list = pd.DataFrame((cursor_zi_new.fetchall()),columns = ['name'])['name'].tolist()
for index,row in df.iterrows(): for index,row in df.iterrows():
if type(row['正确品牌'])!=float: if type(row['正确品牌'])!=float:
......
...@@ -76,9 +76,9 @@ def duplicate_product_update(filepath,sheet_name=0): ...@@ -76,9 +76,9 @@ def duplicate_product_update(filepath,sheet_name=0):
if __name__ == '__main__': if __name__ == '__main__':
# filepath="E:\\ZDZC\\激光打印机产品重复型号分析.xlsx" # filepath="E:\\ZDZC\\激光打印机产品重复型号分析.xlsx"
filepath="E:\\ZDZC\\处理后数据-扫描仪数据0407.xlsx" filepath="E:\\ZDZC\\显示器重复产品分析0506.xlsx"
sheet_name = '重复产品' sheet_name = 'Sheet1'
duplicate_product_update(filepath) duplicate_product_update(filepath, sheet_name)
# filepath="E:\\ZDZC\\处理后数据-扫描仪数据0407.xlsx" # filepath="E:\\ZDZC\\处理后数据-扫描仪数据0407.xlsx"
# sheet_name='重复产品' # sheet_name='重复产品'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment