作者sillygrace (gracee)
看板Python
标题[问题] Xlwings资料型态问题
时间Tue Sep 1 10:07:25 2020
如图最下面那块
https://i.imgur.com/z8vLN2H.jpg
taiwan50_sheet.cells(i, "G").value
这行的资料型态为浮点数(float) 没问题
但当我想抓取同栏前一天资料
taiwan50_sheet.cells(i-1, "G").value
他的资料型态就变成字串(str) 导致後续无法运算
爬文没爬到类似的问题
求神人指点 谢谢!
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.136.201.132 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1598926047.A.2E6.html
1F:→ chickengod: 处理表格用 pandas 方便 df.column.to_numeric() 09/01 20:21