Python: while迴圈 by 儲蓄保險王 · 2022-03-06 Python: while迴圈 total =10 while total < 100: print(total) total = total + 10 執行結果: 10 20 30 40 50 60 70 80 90 相關文章Python: 如何在Excel儲存格中自動換行? cell.alignment = openpyxl.styles.Alignment( wrapText =True) #pd.DataFrame.from_dictPython: 如何調整輸出的xlsx檔,套用最適col width / row height? cell.alignment = Alignment( wrap_text = True)Python中除tuple以外的容器類(list, dict, set)與不可變對象(tuple, str)的更新行為差異Python: 網路爬蟲 selenium 開啟chrome瀏覽器自動連線 ; chrome = webdriver.Chrome( options=options ) ; Python的命名慣例: 全大寫表示常數,首字大寫表示ClassPython: list.index() 只能找到第一個元素的index,若元素有重複,如何找出所有index? indexes = [index for index, value in enumerate(my_list) if value == target]Python: 如何讓關鍵字參數不區分大小寫? processed_kwargs = {key.lower(): value for key, value in kwargs.items()}Python如何讀取json檔?dic = json.loads( json_str ) ; json的保留字:null, true, false(區分大小寫,全小寫), null(非"null",非Null)自動轉譯為None, true(非"true",非True)自動轉譯為True(bool), false(非"false",非False)自動轉譯為False(bool);colab如何掛載雲端硬碟? from google.colab import drive ; json檔的decode與encode? json.load() ; json.loads() ; json.dump() ; json.dumps() #s代表string的意思,有s的指令,參數需使用str typePython 邏輯運算子: and(&) or(|) xor(^) notPython:如何使用 PyMuPDF (import fitz ) 提取 PDF 文本區塊並存儲為 DataFrame ; text: List[ Tuple[float|str|int] ] = page.get_text("blocks")
0 Python: 在使用Pandas進行邏輯運算時,應避免使用or運算子,而應使用|運算子(逐元素比對) ,以免觸發ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). 2023-06-26
近期留言