Commit 22790607 authored by Zhouxingyu's avatar Zhouxingyu

第一次上传代码到gitlab!

parents
Pipeline #4 canceled with stages
import xlrd
import pandas as pd
import numpy as np
from functions import *
class Data_add():
def __init__(self,table_path,out_path,pcode_col,brand_col,price_col,type_col,ser_col,data_col):
'''
依次输入表格路径,输出路径,productcode,品牌,价格,型号,系列对应的列号,以及一个原始数据或者不需要预测数据的列号。
'''
self._table = data_load(table_path).reset_index(drop = True)
self._path_out = out_path
self._data_col = data_col
self._pcode_col = pcode_col
self._brand_col = brand_col
self._price_col = price_col
self._type_col = type_col
self._ser_col = ser_col
def data_add_main(self):
print('数据装填完毕!')
some_lyst=[self._data_col,self._pcode_col,self._price_col,self._brand_col,self._type_col]
n = self._table.shape[1] #列
lyst=[]
for i in range(n):
if in_or_out(some_lyst,i):
lyst.append(i)
continue
else:
lyst_null=moudle11(self._table,i,self._pcode_col)
for j in range(len(lyst_null)):
table=data_add(self._table,lyst_null[j],i,self._pcode_col,self._brand_col,self._price_col,self._type_col,self._ser_col)
print("填写空缺值完毕!")
pre(table,self._path_out)
\ No newline at end of file
This diff is collapsed.
from data_add_class import Data_add
def main():
'''
table_path = input("请输入excel文件地址:")
out_path = input("请输入excel文件输出地址:")
pcode_col = input("请输出 productcode 在第几列:")
price_col = input("请输入价格在第几列:")
brand_col = input("请输入品牌在第几列:")
type_col = input("请输入型号在第几列:")
ser_col = input("请输入系列号在第几列:")
data_col = input("请输入一列自订的不需要填补列的列号:")
'''
table_path = ("lib_nonstand-stand_price.xlsx")
out_path = ("lib_nonstand-stand_new.csv")
data_col=int('3') #输入文本信息,可以为网页url,也可以为其他不需要预测的信息列。
pcode_col=int("2") #输入productcode列号或者sku列号。
price_col=int("47") #输入价格所在列号。
brand_col=int("4") #输入品牌所在列号
type_col=int("38") #输入型号所在列号
ser_col=int("44") #输入系列所在列号
a = Data_add(table_path,out_path,pcode_col,brand_col,price_col,type_col,ser_col,data_col)
a.data_add_main()
if __name__ == "__main__":
main()
\ 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