Commit e7e1c876 authored by sanlu's avatar sanlu

1

parent d018e4ef
...@@ -508,7 +508,7 @@ class data_fetch(): ...@@ -508,7 +508,7 @@ class data_fetch():
return data_table return data_table
if __name__ == '__main__': if __name__ == '__main__':
channel = 'OFS' channel = 'SN'
data_api = data_fetch(model='LXWL_model', localhost=False, source=f'ZH_{channel}') data_api = data_fetch(model='LXWL_model', localhost=False, source=f'ZH_{channel}')
data_api_table = data_api.run() data_api_table = data_api.run()
#param_extract_function(data_api_table,channel) #param_extract_function(data_api_table,channel)
\ No newline at end of file
...@@ -521,11 +521,12 @@ class data_fetch(): ...@@ -521,11 +521,12 @@ class data_fetch():
#data_table = self.tool.judge_peijian(data_table) #data_table = self.tool.judge_peijian(data_table)
data_table = data_table.reset_index() data_table = data_table.reset_index()
data_table.columns = ['SKU','品牌','指数品牌','指数品牌编码','产品名称','供应商子类','指数子类','指数子类编码','url','更新日期','参数项','产品型号','产品价格','来源'] data_table.columns = ['SKU','品牌','指数品牌','指数品牌编码','产品名称','供应商子类','指数子类','指数子类编码','url','更新日期','参数项','产品型号','产品价格','来源']
data_table.to_excel(f'api_data/{self.source}_data_{StyleTime}.xlsx') data_table.to_excel(f'api_data/{self.source}_data_{StyleTime}.xlsx',index=False)
no_category_table = data_table[data_table['指数子类编码'] == '没有匹配的指数子类编码'] no_category_table = data_table[data_table['指数子类编码'] == '没有匹配的指数子类编码']
no_category_table.to_excel(f'api_data/{self.source}_no_category_data_{StyleTime}.xlsx') no_category_table.to_excel(f'api_data/{self.source}_no_category_data_{StyleTime}.xlsx',index=False)
return_error(no_category_table) return_error(no_category_table)
data_table = data_table[data_table['指数子类编码'] != '没有匹配的指数子类编码'] data_table = data_table[data_table['指数子类编码'] != '没有匹配的指数子类编码']
data_table.to_excel(f'api_data/{self.source}_data_{StyleTime}_category_data.xlsx',index=False)
#self.data_table_80 = data_table[data_table['指数子类编码'].isin(self.class_80['指数编码'].tolist())] #self.data_table_80 = data_table[data_table['指数子类编码'].isin(self.class_80['指数编码'].tolist())]
#self.data_table_80.to_excel(f'api_data/{self.source}_data_80_{StyleTime}.xlsx') #self.data_table_80.to_excel(f'api_data/{self.source}_data_80_{StyleTime}.xlsx')
#self.data_table_not80 = data_table[~data_table['指数子类编码'].isin(self.class_80['指数编码'].tolist())] #self.data_table_not80 = data_table[~data_table['指数子类编码'].isin(self.class_80['指数编码'].tolist())]
...@@ -533,7 +534,12 @@ class data_fetch(): ...@@ -533,7 +534,12 @@ class data_fetch():
return data_table return data_table
if __name__ == '__main__': if __name__ == '__main__':
channel = 'SN' channel = 'SN'
data_api = data_fetch(model='LXWL_model', localhost=False, source=f'ZH_{channel}') data_api = data_fetch(model='LXWL_model', localhost=False, source=f'ZH_{channel}')
data_api_table = data_api.run() data_api_table = data_api.run()
'''
table = pd.read_excel('api_data/ZH_SN_no_category_data_2020-01-08.xlsx')
return_error(table)
'''
#param_extract_function(data_api_table,channel) #param_extract_function(data_api_table,channel)
\ No newline at end of file
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