Is it possible to read data from an Excel sheet in

2019-01-19 15:37发布

问题:

I'm doing the following calculation.

worksheet.write_formula('E5', '=({} - A2)'.format(number))

I want to print the value in E5 on the console. Can you help me to do it? Is it possible to do it with Xlsxwriter or should I use a different library to the same?

回答1:

It is not possible to read data from an Excel file using XlsxWriter.

There are some alternatives listed in the documentation.



回答2:

Not answering this specific question, just a suggestion - simply try pandas and read data from excel. Thereafter you can simply manipulate the data using pandas DataFrame built-in methods:

df = pd.read_excel(file_,index_col=None, header=0)

df is the pandas.DataFrame, just go through DataFrame from this it's cookbook site. If you are unaware about this package, you might get surprised by this awesome python module.