1. Html網頁結構介紹-網頁到底如何傳送資料?爬蟲必學
2. 資料傳遞:Get與Post差異,網路封包傳送的差異
3. Html爬蟲Get教學-抓下Yahoo股票資訊,程式交易的第一步
4. Html爬蟲Get實戰-全台最大美食平台FoodPanda爬蟲,把熊貓抓回家
5. 資料分析實戰,熊貓FoodPanda熱門美食系列|看出地區最火料理種類
6. Json爬蟲教學-Google趨勢搜尋|掌握最火關鍵字
7. Json爬蟲實戰-24小時電商PChome爬蟲|雖然我不是個數學家但這聽起來很不錯吧
8. Html爬蟲Post教學-台灣股市資訊|網韭菜們的救星
9. Html爬蟲Post實戰-全球美食平台UberEat爬蟲
10. Pandas爬蟲教學-Yahoo股市爬蟲|不想再盯盤
11. Pandas爬蟲實戰-爬下全台各地區氣象預報歷史資料
12. 資料分析實戰-天氣預報圖像化|一張圖巧妙躲過雨季
SKUï¼Stock Keeping Unitï¼å®åé 管çï¼æ¯ä»éº¼å¢ï¼ä»¥æè£æ¥èä¸åä¾åï¼è¥æ¨ä»å¤©æ³è¦æ¹ä¸æ¬¾å¤å¥ä¾è³£ï¼å çºè³éæéï¼æ以å¤å¥çé¡è²åªæãé»ãç½ãç°ãä¸ç¨®å¤§ç¾é¡è²ãé¤æ¤ä¹å¤ï¼å¤å¥çsize æ¨åªé²ãSãMãLããè¥æ¨çä¸åå庫åªæ¾ä¸ç¨®ä¸æ¨¡ä¸æ¨£çå¤å¥ï¼ç¸½å ±è¦æå¹¾åå庫æè½åæ¾ææå¤å¥å¢ï¼çæ¡æ¯9åå庫ï¼å çº3種é¡è² X 3種size = 9ãèéåå¤å¥çSKUå°±æ¯9ã
ç±ä¸è¿°å¯ç¥ï¼å ä¸ç¨®å¤å¥å°±è¦æºå9åå庫ä¾æ¾å貨ï¼èä¸é¡è²è·å¤§å°éå¦æ¤å®èª¿ï¼æ´ä½æ³å¢å é¡è²æsize ï¼å æ¤SKUæç´æ¥å½±é¿çå°±æ¯ãåå²ææ¬ãï¼è¥æ¯ç¢åéæ¯èªå·±è£½é çï¼é£ä¹æå½±é¿ãé模ææ¬ãï¼å æ¤è¥æ¨ç¾å¨ï¼ææ¯ä¹å¾ï¼çå ¬å¸è³£çæ¯å¯¦é«ç¢åï¼é£ SKU ææ¯åé常éè¦çèéã
å¦ææè¦æ¹å¤å¥ä¾è³£ï¼ææ¬æéçæ æ³ä¸ï¼è¦é¸æä»éº¼é¡è²èSizeï¼
å¨ä»¥å¾æååªè½å»åé·è¼©ãä½åå¸ãæèªå·±ç¢æ¥ç¶é©çæ¹å¼ï¼ä¾é¸æå¤å¥çé¡è²èSizeï¼å ¶å¯¦é件äºæ å¯ä»¥ç¨æ¸æä¾è§£æ±ºï¼å©ç¨Shopeeç¬è²å¯ä»¥ç¬ä¸ç¸åæé¡ä¼¼ä¹ç¢åææçSKUé·å®éï¼æ´çåºä»¥ä¸ç表ï¼æäºéå表ï¼æåæ¯ä¸æ¯å¯ä»¥å¾è¼æå°ç¥éé²åªç¨®é¡è²ãsize é·éææ好ï¼
å¨åç¯æç« ããè¦ç®ç¬è²ãæ詳細ææææå¸ï¼ååè³æï¼çè¨è©è«ãç¶ä¸ä»¥ã è±è¥¯è¡«ãéåååçºä¾åï¼å°æ¥çºç¬ä¸ä¾çè³æé²è¡åæãæ¬æç« çµ±æ´ææè¦ç®å¸å ´ä¸ã è±è¥¯è¡«ãå¨ä¸å尺寸ãé¡è²ä¸çé·éï¼è¥æ¨æ¯ä¸åæ£æ³åå ¥éåå¸å ´çå» åï¼æ£å¨è¦æ±ååçSKUï¼éåè¡¨æ ¼è½å¤ å¾æ顯給æ¨å¸å ´æé«é·éç尺寸èé¡è²ï¼åå ¥å¸å ´é²éååèæºæ²é¯ï¼
å©ç¨ pandasç read_csv()æ¹æ³ä¾å¯å ¥æç« ããè¦ç®ç¬è²ãæ詳細ææææå¸ï¼ååè³æï¼çè¨è©è«ãä¸æç¬ä¸ä¾çæªæ¡ã
import pandas as pd
#--- å¯å
¥è³æ
comment_data = pd.read_csv('è±è¥¯è¡«_çè¨è³æ.csv')
# æ¥çè³ææ¬ä½
comment_data.columns
å¨åææ¯åååé·éæï¼æç¼ç¾ä¸ååé¡ï¼æ¯åå家ç尺寸é¡è²å®ç¾©ä¸åï¼èä¾ä¾èªªã2XLãèãXXLãå ¶å¯¦æçæ¯åä¸åè¡£æ Sizeï¼ä½ç¨å¼ä¸¦ä¸æ¯é£éº¼è°æï¼ææå®ç¶æå ©ç¨®ä¸åç Sizeï¼å æ¤éè¦å ä½¿ç¨ replace()æ¹æ³å°ææç尺寸ãé¡è²é²è¡çµ±ä¸ã
#å
å代åæè©èª
#å
å代å
¨å½¢åæ¯
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('ï¼³','S')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('ï¼','M')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('L','L')
#å¾æ大çéå§å代ï¼å¤§å°ºç¢¼ï¼
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XXXXXXXXL','8@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('8XL','8@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XXXXXXXL','7@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('7XL','7@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XXXXXXL','6@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('6XL','6@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XXXXXL','5@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('5XL','5@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XXXXL','4@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('4XL','4@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XXXL','3@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('3XL','3@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XXL','2@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('2XL','2@')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XL','1@')
#å¾æå°çéå§å代ï¼å°å°ºç¢¼ï¼
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XXS','3~')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('3XS','3~')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('XS','2~')
#å代ç¹æ®é¡è²
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('æ·±ç°','1#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('çå
ç¶ ','2#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('è»ç¶ è²','3#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('é
ç´
','4#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('æ·±è','5#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('å¢¨ç¶ ','6#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('ç²æ©','7#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('ç´«ç²','8#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('æ£ç´
','9#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('寶è','10#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('å¡å
¶','11#')
comment_data['ååè¦æ ¼'] = comment_data['ååè¦æ ¼'].str.replace('æ¡ç´
','æ¡')
æ¨å¯è½æå¾å¥½å¥ï¼çºä½è¦å°ãXXXLãå代æã3@ãï¼åèä¸å代æã3XLãåèæ´å¥½é±è®ï¼å ¶åå å¨æ¼è¥å代æã3XLã以å¾ï¼ççè¥æå代å°ãXLãéå Sizeçæåï¼ã3XLãä¹æåå°å½±é¿ï¼å æ¤ç¡éç¨ä¸åãä¸å¤ªæåºç¾ãçåå ä¾å代ã
å©ç¨ééç forè¿´åï¼æª¢æ¥æ¯æ¶è²»è³æä¸çåå尺寸èé¡è²ï¼å©ç¨ contains()æ¹æ³ä¾æª¢æ¥åæ¬ä½æ¯å¦åææ該尺寸èé¡è²çééµååºç¾ãéå檢æ¥æ¹æ³å¯è½æéºæ¼æ許å¤ãé¡è²ãï¼å çºå¨ç¯ä¾ç¨å¼ç¢¼ä¸åªæ28種é¡è²ï¼ç¶ç¶ä¸çä¸çè¡£æé¡è²ä¸å®é è¶ éåæ¸éï¼ä½æååªè½ç¡äººå·¥æ大çè½åååºææè¼é«é »çåºç¾çé¡è²ï¼ä»¥æä¾æ¡è³¼ä½åèã
color = ['é»','ç½','ç°','ç¶ ','ç²è²','è','æ©','è','ç´«è²','åå¡è²','ç¦ç³','æ¡','ç´
'
,'é»','èé','æ','1#','2#','3#','4#','5#','6#','7#','8#','9#','10#','11#']
size = ['8@','7@','6@','5@','4@','3@','2@','1@','L','M','S','2~','3~']
#--- åµé å¸å ´SKUçµ±è¨è¡¨
counter=[]
for c in color:
container=[]
for s in size:
container.append(
len(allpro[ allpro[0].str.contains(c) &
allpro[0].str.contains(s)
])
)
counter.append(container)
# ç¢åéç¼å¤§è£å¸å®æ
buyer = pd.DataFrame(counter)
buyer.columns = ['8XL','7XL','6XL','5XL','4XL','3XL','2XL','1XL','L','M','S','2XS','3XS']
buyer.index = ['é»','ç½','ç°','ç¶ ','ç²è²','è','æ©','è','ç´«è²','åå¡è²',
'ç¦ç³','æ¡','ç´
' ,'é»','èé','æ','æ·±ç°','çå
ç¶ ','è»ç¶ è²',
'é
ç´
', 'æ·±è','å¢¨ç¶ ','ç²æ©','ç´«ç²','æ£ç´
','寶è', 'å¡å
¶']
ç¾å¨æå就以æ飾åçèéçè§åº¦ï¼ä¾æè該å¦ä½é²è²¨ã尺寸çé¨åï¼å¾æ顯å°éä¸å¨ S5XLï¼è¥æ¯è³éæµæéå¯ä»¥é²è²¨ S3XLå³å¯ãå¦å¤é¡è²çé¨åï¼ä¸»è¦çå¹¾åé·éå
å«é»ãç½ãç°ãç¶ ãèãç´
ãé»ãèãéï¼æ¯è¼ä»¤ä½è
æå¤çæ¯èè²ï¼å¨å°è±¡ä¸èè²è±è¥¯è¡«ä½è
èªå·±æ¯ä¸å¸¸çå°ï¼ä½å¾éååæé·éä¸å¯ä»¥ç¼ç¾ï¼å»æ¯è±è¥¯è¡«ä¸»è¦é·éä¹ä¸ã
作者:楊超霆 行銷搬進大程式 創辦人