儲蓄保險王 Blog
Python: os.listdir(路徑) -> list ,回傳該路徑中有那些檔案,目錄; fpath = os.path.join(folder, “*.csv” ) ; glob.glob(fpath) #通配符匹配(globbing),抓取目錄下的指定檔案名稱
os.listdir()參考資料 C:\Python\term_fr...
Python:如何使用csv.reader() 讀取csv檔案?若該檔案奇異列長度太短,如何用try:~except:~避免取直欄時出現IndexError: list index out of range?
自己建立的csv檔案: 除了奇異的那一列 每一列都有四筆資料 要如何...
Python: 字串 str.find(關鍵字[,start][,end]),找不到的話回傳-1,如何找出資料字串中,所有關鍵字的index?詞頻計算
資料來源: https://docs.python.org/3/li...
Python四種容器(list, tuple, set, dict)的CRUD(Create創建, Read讀取, Update修改, Delete刪除)
CRUD\容器 空list: [] 空tuple:() 空set: ...
Python常用的模組內建常數; __name__ ; __file__ ; __doc__ ; __all__ ;__dict__; vars()->Dict[str,str] ; dir()->List[str]
vars() type是dict dir() 只有key, type...
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]切片
# -*- coding: utf-8 -*- import pan...

近期留言