Read merged cells in Excel with Python
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to read merged cells of Excel with Python using xlrd. My Excel: (note that the first column is merged across the three rows) A B C +---+---+----+ 1 | 2 | 0 | 30 | + +---+----+ 2 | | 1 | 20 | + +---+----+ 3 | | 5 | 52 | +---+---+----+ I would like to read the third line of the first column as equal to 2 in this example, but it returns '' . Do you have any idea how to get to the value of the merged cell? My code: all_data = [[]] excel = xlrd.open_workbook(excel_dir+ excel_file) sheet_0 = excel.sheet_by_index(0) # Open the first tab