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 堆疊演算法實作:從扁平標題清單快速建立階層父子關係Python: 如何使用matplotlib繪製盒鬚圖?df.boxplot(column='value', by='fixture', grid=False, showmeans=True, showfliers=True, ax=ax) ; 如何獲取pandas.DataFrame多層索引MultiIndex中的第二層內容? df.columns.get_level_values(1).unique()Python-docx 進階解析:為什麼你的程式讀不到表格裡的文字? —— 深入比較 doc.paragraphs、doc.tables 與底層 doc.element.body; from docx.text.paragraph import Paragraph #將 XML CT_P轉為 Paragraph 物件; from docx.table import Table #將 XML CT_Tbl轉為 Table 物件Python: 字串 str.find(關鍵字[,start][,end]),找不到的話回傳-1,如何找出資料字串中,所有關鍵字的index?詞頻計算python:如何用 pandas.DataFrame.dropna() 刪除空列(axis=0) 空欄(axis=1) ; df_drop0 = df.dropna(axis=0, how=’all’)Python: 如何利用dict.pop() 對字典重新排序? dict.pop() #刪除key,回傳valuePython pandas 逐列讀取教學:itertuples() vs iterrows() ; for row in df.itertuples ( index=False, name=None)Python:如何建立新資料夾?os.mkdir() ; os.makedirs() ; 有何差別?Python繪圖 import matplotlib.pyplot as plt ; plt.annotate(annot_min,(yMinIdx,minY)) ; ax.annotate(text,xy,...) #註釋 ; 通用屬性 ; linestyle ;圖例 legend ; set_title()、set_xlabel()、set_ylabel() ; 網格 ax.grid(visible=None, axis='both', ...) ; ax.set_xticks() ; ax.set_yticks()
0 Python:如何使用csv.reader() 讀取csv檔案?若該檔案奇異列長度太短,如何用try:~except:~避免取直欄時出現IndexError: list index out of range? 2022-11-24
0 Python 三元運算子 (Ternary Operator) 完全指南; status = “成年” if age >= 18 else “未成年” ; 值_如果為真 if 條件判斷 else 值_如果為假 #取這個值 (如果條件成立),否則 (取那個值) 2025-12-16
0 Python: pandas.DataFrame如何移除所有空白列?if df_raw.iloc[r,0] is np.nan: nanLst.append(r) ; df_drop0 = df_raw.drop(nanLst,axis=0) ; pandas.isna() ;df_drop0 = df_raw.drop(nanLst,axis=0).reset_index(drop=True) 2022-12-06
近期留言