[英]How to add new column and row to .xls file using xlrd
How do you add a new column and/or row to a sheet in xlrd? 如何在xlrd的工作表中添加新的列和/或行?
I have a .xls file that I read using open_workbook() and I need to add a new column("bouncebacks") to the first sheet then new rows to that sheet but I cannot find any functions in the xlrd documentation that shows how to add new rows and/or columns? 我有一个使用open_workbook()读取的.xls文件,我需要在第一张工作表中添加一个新列(“ bouncebacks”),然后向该工作表中添加新行,但是我无法在xlrd文档中找到任何功能来显示如何添加新的行和/或列?
If I cant add a row/column in xlrd is there another way/library that allows me to add a row or column to an .xls file? 如果我无法在xlrd中添加行/列,是否有另一种方法/库可以让我向.xls文件添加行或列?
Can you show me how I can add a row and column to a sheet? 您能告诉我如何在工作表中添加行和列吗?
import xlrd
book = xlrd.open_workbook("abc.xls")
sheet = book.sheet_by_index(0)
# how do I add a new column("bouncebacks") to the sheet?
# how do I add a new row to the sheet?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.