Python list[] dictionary{key: value},如何從兩個list,建立一個dictionary? by 儲蓄保險王 · 2022-09-04 prod = [“17 LCD”, “32吋電視”] pric = [10000, 20000] dic = {} key = “” for k in range(len(prod)): key = prod[k] dic[key] = pric[k] print(dic) 相關文章Python實戰教學: yield 與 yield from 解析,遞迴遍歷docx所有Paragraph(包含儲存格_Cell 中的Paragraph) ; from docx.document import Document as DocxDocument #類別,非function ; from docx.table import _Cell, Table #儲存格/表格 類別Python: matplotlib繪圖如何共用x axis, y axis, x label, ylabel? fig, axs = plt.subplots(nrows=2, ncols=3, sharex=True, sharey=True) ; plt.suplabel()Word變更尺規單位,精準定位點Python:如何確保只有單欄資料的變數,其型態是 pandas.Series 而非單欄的DataFrame? pandas.DataFrame.squeeze() ; df.set_index() 將兩欄的df,其中一欄設為index後,其型態是單欄的DataFrame還是Series?Python如何讀取csv檔? csv.reader(f) , 如何計算IRR? numpy_financial.irr() 免費下載IRR計算機,如何寫入csv檔? csv.writer(f).writerows(2D List) ; if not os.path.exists(folder): os.makedirs(folder)Python的keyword: import keyword ; keyword.kwlistPython:如何用pandas.concat() 合併兩個DataFrame並重置index? pd.concat([df1, df2]) .reset_index(drop=True) ; pd.concat([df1, df2], ignore_index=True)Python str.split() 的 maxsplit 速懂教學(含常見陷阱與實用對比);如何分割標題號 與 標題文字? "3.1.2 Test Strategy".split(maxsplit=1) #注意中間無底線: 非max_splitPython 檔案讀取file.read(), file.readlines()返回2D list,\n也會讀入 , file.readline()只讀取一行
0 Word長篇文件編輯,TQC考題402狂犬病,ALT + F9將所有超連結展開為功能變數;CTRL+A(全選) > Ctrl + shift +F9 取消所有超連結;參考資料>插入索引>自動標記,隱藏標記後,參考資料>插入索引 2022-03-15
近期留言