zip 是 python 很好用但 用的人卻不多的function
寫 python 時我常常用 zip 把兩個 list 合併成一個 dict ..
dict 要查群時 會方便很多
hours = [x for x in range(0,24)]
Counts = [int(0) for x in range(0,24)]
hourUpCounts = dict(zip(hours,Counts))
hourDownCounts = dict(zip(hours,Counts))
hourSpeed = dict(zip(hours,Counts))
2019年1月23日 星期三
訂閱:
張貼留言 (Atom)
Bloomberg Markets Wrap 2025-08-15: 股市因美國數據下漲,川普與普丁會議獲關注
Bloomberg Markets Wrap 2025-08-15: 股市因美國數據下滑,川普與普丁會談受關注 發佈日期:2025-08-15 本篇文章翻譯與整理自 Bloomberg Markets Wrap(經 SWI swissin fo.ch 彙整),該報111導回顧了...
-
正規化檢查是很常用的功能, 如輸入檢查 如你是要使用者輸入如 mac address 會 IP address 時 會用來檢查輸入正不正確 import re pattern = r"([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}" ...
-
昨天因工作需求, 用了 pandas , OS 這幾個 library , 因為要讓同事的 windows 跑 , 且他的電腦沒有 python 環境 於是直覺就用 Pyinstaller 打包 , 原本用 -F 包單個 file , 但要快 3 分鐘才開始run g...
-
ChatGPT agent 模式還蠻厲害的 雖然線在可用長景不多

沒有留言:
張貼留言