Python 保存数据到 Exel
生活随笔
收集整理的這篇文章主要介紹了
Python 保存数据到 Exel
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Python 保存數據到 Exel
1、安裝包
pip install xlwt2、保存數據到 Exel
import xlwt# 新建表格book = xlwt.Workbook(encoding='utf-8', style_compression=0)sheet = book.add_sheet('mysheet', cell_overwrite_ok=True)# 往第一行的1到10列寫數據for i in range(10):# 數字四舍五入保留兩位小數 sheet.write(0, i, round(1.7416,2))# 保存表格book.save('data.xls')GOOD LUCK!
與50位技術專家面對面20年技術見證,附贈技術全景圖
總結
以上是生活随笔為你收集整理的Python 保存数据到 Exel的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: matlab人民币识别,MATLAB-O
- 下一篇: @Transient注解作用