[問題] openpyxl list寫入column

看板Python作者 (鳳山下智久)時間7年前 (2018/07/18 11:06), 編輯推噓1(102)
留言3則, 2人參與, 7年前最新討論串1/1
Hi 請教各位大大 小弟遇到一個問題,想把list裡面的值寫到excel裡面的一個column裡 假設我有一個list = [1857, 2391, 1738] 結果想呈現如下圖 https://imgur.com/TehykDE
感謝各位大神了!! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.248.18.139 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1531883185.A.25A.html

07/18 11:08, 7年前 , 1F
這應該google就有了...很簡單
07/18 11:08, 1F

07/24 22:47, 7年前 , 2F
用pandas的話: import pandas as pd
07/24 22:47, 2F

07/24 22:48, 7年前 , 3F
pd.DataFrame([1,2,3]).to_excel('tmp.xlsx')
07/24 22:48, 3F
文章代碼(AID): #1RJgwn9Q (Python)
文章代碼(AID): #1RJgwn9Q (Python)