Python相關網址 by 儲蓄保險王 · 2022-10-15 https://www.python-excel.org https://www.xlwings.org/ 相關文章Python 正則表示法 中 ?: 與非捕獲群組的精要筆記, ?的多重語義:量詞0 or 1次, +?非貪婪量詞, ?:非捕獲群組, ?P<name> 命名捕獲組, ?= 正向前瞻 斷言, ?! 負向前瞻斷言Python: 如何正確地將pandas.Series(索引需對齊)和列表list(長度需一致)指配給DataFrame的新column?Python 數據處理進階技巧:掌握 pandas.Series.duplicated() 的 keep 參數Python 入門教學:用 Path.stat() 與 os.stat() 讀懂檔案資訊; from pathlib import Path ; type(p).__name__ #'WindowsPath'; p.stat().st_size == os.stat(p).st_size == os.path.getsize(p)Python XML 的生死輪迴:深入理解 lxml.etree.fromstring(xml_bytes) #Bytes → Element Object 與 lxml.etree.tostring(Element, encoding= "utf-8") #Element Object → Bytes ; 處理 XML 時,盡量全程保持 Bytes (二進位) 狀態。Python × Ollama 教學:用本地 LLM (Large Language Model 大語言模型)將 JSON 逐筆自動轉成中文自然語言Python tensorflow深度學習中的過擬合防治:早停策略,動態調整學習率,Dropout,正則化調整lossPython爬蟲: 如何確認Chrome瀏覽器版本? chrome://settings/help ; chrome://version/ 如何尋找對應的Chrome Driver? https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.jsonPython 讀取 DOCX 圖片關聯:qn+find/findall 與 XPath 的實戰對照 from lxml import etree ; from docx.oxml.ns import qn; lxml.etree._Element.findall( f".//{ qn('a:blip') }" ) ; .get( qn("r:embed") ) #獲取 屬性名 'r:embed' 的 屬性值(如: 'rId4') ; lxml.etree._Element.xpath( "//a:blip/@r:embed", namespaces = NS) #/@r:embed = 獲取 屬性名 'r:embed' 的 屬性值(如: 'rId4'),使用.findall() 要先.findall()獲取List[_Element],再迴圈_Element.get()獲取屬性值, .xpath() 第一個參數path 使用"//a:blip/@r:embed" ,可直接獲取屬性值(List[str]如: ['rId4', 'rId5']) ; 如何對docx真實移除圖片瘦身?
近期留言