Commit 0772db18 by 岳巧源

add someline

parent 2550f2e5
Showing with 4 additions and 5 deletions
......@@ -46,14 +46,13 @@ class HandleCSV:
logger.error("文件 %s 格式错误" % path)
return []
for i in range(len(df.index.values)):
if i > 100:
break
# print(df.loc[i, title_arr[0]])
table = dict()
table['price_is_us'] = False
table['ladder_price'] = []
table['supplier_name'] = 'Waldom人民币'
table['goods_sn'] = ''
table['multiple'] = '0'
batch_sn_map = dict()
for j in range(len(title_arr)):
ladder_item_map = dict()
......@@ -72,9 +71,9 @@ class HandleCSV:
else:
table['stock'] = int(data)
elif title_arr[j] == 'MOQ':
table['moq'] = int(data)
table['moq'] = str(data)
elif title_arr[j] in ladder_map:
if len(str(data).strip()) != 0 and str(data).strip().isdigit():
if len(str(data).strip()) != 0 and str(data).strip() != "nan" and str(data).strip() != "NaN":
ladder_item_map['purchases'] = int(data)
ladder_item_map['price_us'] = float(0)
ladder_item_map['price_cn'] = float(df.loc[i, ladder_map[title_arr[j]]])
......@@ -113,7 +112,7 @@ class HandleCSV:
if __name__ == '__main__':
start = time.time()
HandleCSV().parse('Tianyang_Inventory_Feed_RMB.csv')
HandleCSV().parse('Tianyang_Inventory_Feed_RMB.xlsx')
end = time.time()
print("spend time: " + str(end - start))
......
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 sign in to comment