添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
机灵的手电筒  ·  Re:openvino.runtime - ...·  昨天    · 
粗眉毛的青蛙  ·  spark ...·  昨天    · 
健壮的烤地瓜  ·  pip install -r ...·  13 小时前    · 
失恋的鞭炮  ·  PYTHON利用ElementTree解析X ...·  3 小时前    · 
不拘小节的米饭  ·  Tutorial: ML ...·  1 月前    · 
奔跑的洋葱  ·  从自有应用创建 Alexa ...·  2 月前    · 
讲道义的山羊  ·  Q-Chem 4.3 User’s ...·  2 月前    · 
苦恼的白开水  ·  IIS 日志的查看,iis ...·  8 月前    · 
Lowest price ever! Learn Generative AI for 48% less!
Get my discount
0

AttributeError: 'str' object has no attribute 'A'

https://code.sololearn.com/cgmb7zFslwgT#py I'm trying to rapidly extract data from a spreadsheet, but keep getting errors I am using Visual Studio Code and I have run "pip install xlrd" https://code.sololearn.com/cgmb7zFslwgT#py from xlrd import open_workbook wb = open_workbook(r'C:\Users\steve\Google Drive\All\code\Book2.xlsx') values = [] for s in wb.sheets(): #print 'Sheet:',s.name for row in range(1, s.nrows): col_names = s.row(0) col_value = [] for name, col in zip(col_names, range(s.ncols)): value = (s.cell(row,col).value) try : value = str(int(value)) except : pass col_value.append((name.value, value)) values.append(col_value) (r'C:\Users\steve\Google Drive\All\code\Book2.xlsx'.A, 1) Error: Traceback (most recent call last): File "c:/Users/steve/Google Drive/All/code/Code/open Exel.py", line 15, in <module> values.append(col_value) (r'C:\Users\steve\Google Drive\All\code\Book2.xlsx'.A, 3) AttributeError: 'str' object has no attribute 'A'

26th Mar 2020, 6:56 PM
Steven
Steven - avatar
5 Answers