How can I see the formulas of an excel spreadsheet in pandas / python?
Yes, it is possible. I recently found a package that solves this issue in a quite sophisticated way. It is called portable-spreadsheet (available via pip install portable-spreadsheet
). It basically encapsulates xlsxwriter
. Here is a simple example:
import portable_spreadsheet as pssheet = ps.Spreadsheet.create_new_sheet(5, 5)# Set valuessheet.iloc[0, 0] = 25 # Set A1sheet.iloc[1, 0] = sheet.iloc[0, 0] # reference to A1# Export to Excelsheet.to_excel('output/sample.xlsx')
It works in a similar way as Pandas Dataframe.