Tag: cell

用Python读取Excel中的合并单元格

我正在尝试使用xlrd读取Python的合并单元格。 我的Excel:(注意,第一列是合并在三行) ABC +—+—+—-+ 1 | 2 | 0 | 30 | + +—+—-+ 2 | | 1 | 20 | + +—+—-+ 3 | | 5 | 52 | +—+—+—-+ 我想在这个例子中读第一列的第三行等于2,但是它返回'' 。 你有什么想法如何获得合并单元格的价值? 我的代码: all_data = [[]] excel = xlrd.open_workbook(excel_dir+ excel_file) sheet_0 = excel.sheet_by_index(0) # Open the first tab for row_index in range(sheet_0.nrows): row= […]