1 把基準資料提出
import pandas as pd
dframe1 = pd.read_excel("window regulator分析報告分析.xlsx", sheetname="sheet1")
dframe2 = pd.read_excel("window regulator分析報告分析.xlsx", sheetname="sheet2")
dframe1["sku"] ="#"
# df = pd.read_excel("window regulator_test.xlsx")
# print(df.head())
print(dframe1.head())
print(dframe2.head())
# df = pd.dataframe( ,index=["0"])
df = pd.dataframe(columns = ["ebayno", "p_sku", "sale", "sku"])
print(df)
sku = dframe2.sku.values
p_skus = dframe2.p_sku.values
# print(p_skus)
i = 0
for ps in p_skus :
dframe1.loc[dframe1.p_sku == ps,"sku"] = sku[i]
# print(dframe1.loc[dframe1.p_sku == ps])
print(df)
i = i + 1
# print(dframe1)
# print(sku.values) #將series變成陣列
print(df)
df = df[["sku","ebayno","sale"]]
df.to_csv("std.csv",encoding="gbk",index=false )
2把feedback**資料提出
import xlrd
import pandas as pd
from collections import counter
data = xlrd.open_workbook("window regulator.xlsx") # 開啟excel,讀入sku
# data = xlrd.open_workbook("window regulator-oe_test.xlsx") # 開啟excel,讀入sku , 測試用
table = data.sheet_by_index(0) # 讀sheet
nrows = table.nrows # 獲得行數
result =
newdf = pd.dataframe(columns=["sku","kind","ebayid","ebayno"])
for i in range(1, nrows): #
rows = table.row_values(i) # 行的資料放在陣列裡
sku = rows[0]
print(sku)
df = pd.read_csv("sku\\feedback_"+str(sku)+".csv" , encoding="gbk")
df = df[["sku","kind","ebayid","ebayno"]]
ebayids = df["ebayid"].values
# print(ebayids)
count = counter(ebayids) # 返回counter物件,是字典的子類,可以採用字典的方法
ebayid =
sale =
maxsale = 0
for key, value in count.items():
# print(ebayid)
# print(sale)
df = df.drop_duplicates()
df["mysale"]=sale
# print(df)
# print(df)
# if i ==1 :
# print("--")
# # print(newdf)
# break
newdf.to_csv("my.csv", index=false ,encoding="utf-8" , columns=["sku","kind","ebayid","ebayno","mysale"])
3將兩個資料做比較,分析feedback的利用率
import pandas as pd
import xlrd
import csv
mycsv = pd.read_csv("my.csv")
stdcsv = pd.read_csv("std.csv")
# std_my_csv = pd.dataframe(columns=["sku","ebayno","sale","kind","ebayid"])
out = open("std_my.csv","w",newline="")
csv_writer = csv.writer(out)
csv_writer.writerow(["sku","ebayno","sale","kind","ebayid" , "mysale"])
data = xlrd.open_workbook("window regulator.xlsx") # 開啟excel,讀入sku
# data = xlrd.open_workbook("window regulator-oe_test.xlsx") # 開啟excel,讀入sku , 測試用
table = data.sheet_by_index(0) # 讀sheet
nrows = table.nrows # 獲得行數
result =
for i in range(1, nrows): #
rows = table.row_values(i) # 行的資料放在陣列裡
sku = rows[0]
print(sku)
mysku = mycsv[mycsv.sku == sku]
stdsku = stdcsv[stdcsv.sku == sku]
for row in stdsku.values:
sku = row[0]
ebayno = row[1]
sale = row[2]
myebaynos = mysku["ebayno"].values
# print(myebaynos)
if ebayno in myebaynos:
myrow = mysku[mysku.ebayno == ebayno].values[0]
# print(myrow)
kind = myrow[1]
ebayid = myrow[2]
mysale = myrow[4]
# print(sku , ebayno , sale , kind , ebayid)
csv_writer.writerow([sku , ebayno , sale , kind , ebayid, mysale])
else:
# print(sku , ebayno , sale , "nan", "nan")
csv_writer.writerow([sku, ebayno, sale, "#", "#","#"])
for row in mysku.values:
sku = row[0]
kind = row[1]
ebayid = row[2]
ebayno = row[3]
mysale = row[4]
stdebaynos = stdsku["ebayno"].values
# print(myebaynos)
if ebayno in stdebaynos:
continue
else:
# print(sku, ebayno, "nan", kind, ebayid,mysale )
csv_writer.writerow([sku, ebayno, "#", kind, ebayid , mysale ])
呼叫WebServices傳參對方驗證為空
呼叫webservices傳參對方驗證為空 net環境下呼叫對方webservices,對方驗證一直提示為空。最後看到引用的webservices有奇怪的東西出現 入下面 欄位nperprm會對應的有乙個 nperprmfieldspecified system.xml.serialization....
出現bug應對方法
先檢查 1,變數名 介面名寫錯 2,引數有沒有傳錯,引數有沒有值 特別是拼鏈結的時候 3,介面返回的資料有沒有錯 4,資料沒問題時,可能是變更檢測,重新賦值 注意 angular 所有元件現在都使用onpush策略。使用此策略的元件不會對物件屬性或陣列子項的變化做出響應 5,使用元件時,注意資料結構...
參考蘋果對方法的命名的規範
我經常用的字段有如下 需要注意的一點就是,你存的是id,還是fullname?還是code 應該區分開來比較好。id 主鍵,每個實體都有他唯一的標識碼,就像我們的 號碼,一般建議採用單主鍵,好做外來鍵,設定資料庫主外來鍵關聯約束。code 編號,可以不輸入,但是不能重複,我有時候會用程式判斷,有時候...