Python TQC考題804 大寫轉換 .title() .upper() .lower() by 儲蓄保險王 · 2022-05-02 #Python TQC考題804 大寫轉換 s=input() print(s.upper()) print(s.title()) #三種都做 特價 日本ChiBee no dog no life-1 短袖T恤 特價 【Herschel】 Heritage™ 行李袋 40L 特價 中性肌保養✦美白X緊緻-防曬DD霜/緊緻精華/透白增效精華 特價 UPF50+防曬冰感A+級透氣排汗機能冰鋒衣6.0 箱裝組任選【第2箱5折】 特價 日本ChiBee no dog no life-1 短袖T恤 相關文章掌握Python NumPy陣列扁平化:flatten()、ravel()與reshape(-1)的完整指南 #flatten(): 總是建立副本Python: 二進制的負數如何表示?補數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: list.index(元素) 搜尋元素位於list中的那一個indexPython: 如何檢查NaN(Not a Number)? 為什麼 np.nan == np.nan 返回 False? numpy.isnan() ; pandas.isna() ; pandas.isnull() ; np.isnan() 只能處理數值型資料(np.nan) ; pd.isna() , pd.isnull() 除了np.nan以外,還可以處理None, pd.DataFrame, pd.SeriesPython: 如何使用random.sample 從10個號碼中挑出不重複的三個號碼; random.shuffle弄亂十個數字的順序後,挑選前三個數字Python:如何使用 pyautogui 進行自動點擊?Python爬蟲: 理解 response.text 與 BeautifulSoup 對象之間的關鍵區別 from bs4 import BeautifulSoup as bs ; response = requests.get(url) ; soup = bs(response.text) ; bs4.element.Tag .find_all() ; .select() ; .find() 差別為何?soup是大HTML, tag是小HTML,可以使用相同的方法Python: pandas.Series.nunique() 方法說明,計算唯一值的數量,與 len( pandas.Series.unique() ) 同效果
0 Python: pandas.DataFrame()處理雙維度資料,dict跟2D list轉為DataFrame有何差別?如何用index及columns屬性客製化index跟欄位名稱?df.index = [“一”,”二”,”三”,”四”] ; df.columns = 使用.head(n) ; .tail(m) ;取首n列,尾m列; .at[index,欄位名稱] 取單一資料 ; .iat[index,欄位順序] 取單一資料 ; .loc[index,欄位名稱] 取資料 ; .iloc[index,欄位順序];df.iloc[ [0,1],[0,2]])取資料 ; df.iloc[ 0:3,0:2]切片 2022-11-11
0 Python: matplotlib.pyplot ; lines = ax.plot(x, y) ; 如果y是2D的 pandas.DataFrame ; 如何一次加入所有欄標籤當作圖例(legend)的labels? labels= y.columns.tolist() ; ax.legend(lines, labels) 2023-05-21
0 Python TQC考題: 輸入一個正整數n,並讀取read.txt內容,將首n列的每個英文字首字大寫輸出write.txt ; pandas.Series.str.title() #輸出csv或xlsx時,如何不輸出index 跟 header ? .to_csv( “write.txt”, index=False, header=False) 2023-11-18
近期留言