Spreadsheet#
- class Spreadsheet(*args, **kwargs)[source]#
Bases:
Blobject
A class for reading and writing Excel files in binary format. No disk IO needs to happen to manipulate the spreadsheets with openpyxl (or xlrd or pandas).
New version 1.3.0: Changed default from xlrd to openpyxl and added self.wb attribute to avoid the need to reload workbooks.
Examples:
.. rubric:: Methods
- writecells(cells=None, startrow=None, startcol=None, vals=None, sheetname=None, sheetnum=None, verbose=False, wbargs=None)[source]#
Specify cells to write. Can supply either a list of cells of the same length as the values, or else specify a starting row and column and write the values from there.
Examples:
S = sc.Spreadsheet() S.writecells(cells=['A6','B7'], vals=['Cat','Dog']) # Method 1 S.writecells(cells=[np.array([2,3])+i for i in range(2)], vals=['Foo', 'Bar']) # Method 2 S.writecells(startrow=14, startcol=1, vals=np.random.rand(3,3)) # Method 3 S.save('myfile.xlsx')