Python讀寫Excel最好用的方法(Pandas)
2023-08-25 16:12 作者:biggertree-Jing | 我要投稿
感覺使用 Pandas讀寫 Excel 是Python中最好用的方法,其他 openpyxl ,?xlrd , xlwt 模塊繁瑣且常有功能限制。言歸正傳,Pandas 讀寫 Excel 只需要兩個(gè)函數(shù): pandas.read_excel() 和 DataFrame.to_excel() 。函數(shù)參數(shù)及用法記錄如下,用時(shí)備查。
1.pandas.read_excel()? 讀取excel
函數(shù)表達(dá)式:
參數(shù)說明:
使用示例:
讀取多個(gè)表(一個(gè)excel的多個(gè)sheet)
2. DataFrame.to_excel()? 寫入excel
參數(shù)說明:
使用示例: