excel列
sheet = data.sheet_by_index(0)
sheet.ncols
sheet.col(1)第二列的数据单元格对象组成的列表
sheet.col(1)[2].value
sheet.col_values(1) 所有单元格value组成的列表
sheet.col_types(1) 0空,1字符,2 数字
sheet.ncols # 查看有效列数
sheet.col(列索引) # 该列单元格对象组成的列表(带类型)
sheet.col_value(索引) # 该列单元格对象组成的列表(不带类型)
sheet.col(列索引)[行索引] # 获得指定单元格的内容(带类型)
sheet.col(列索引)[行索引].value # 获得指定单元格的内容(不带类型)
sheet.col_types(索引) # 该列单元格对象组成的列表数据类型
sheey = data.sheet_by_index(0). 获取下标为0的表
sheet.nclos 所有列
sheet.col(1) 获取第二列的所有数据 => 返回的是数组
sheet.col(1)[2] .value 获取第二列的第三行的数据
sheet.col_values(1) 该列所有单元格的value组成的列表
sheet.col_types(1) 该列的所有类型
#操作Excel列 sheet=data.sheet_by_index(0)#通过索引的方式获取第一个工作表格 print(sheet.ncols)#打印一下工作表中有效的数据列数 print(sheet.col(1))#打印该列单元格对象组成的列表 print(sheet.col_types(0))#获取单元格的数据类型 print(sheet.col(1)[0])#得到指定列单元格的值,第二列第一行 print(sheet.col(1)[0].value)#得到指定列单元格的值,第二列第一行 print(sheet.col_values(0))#得到指定列单元格的值组成的列表
sheet=data.sheet_by_index(0) print(sheet.ncols) print(sheet.col(1))#该列单元格对象组成的列表 print(sheet.col(1)[2].value) print(sheet.col_values(1))#返回该列所有单元格组成列表的值 print(sheet.col_types(5))
操作excel的列
# EXCEL列操作 sheet = data.sheet_by_index(0) print(sheet.ncols) print(sheet.col(1)) # 返回该列单元格对象所组成的列表 print(sheet.col(1)[2]) print(sheet.col_values(1)) # 返回指定列所有单元格值组成的列表,不包含数据类型。 print(sheet.col_types(1)) #返回指定列所有单元格的类型