pyexcel.Sheet.format¶
-
Sheet.
format
(formatter)¶ Apply a formatting action for the whole sheet
Example:
>>> import pyexcel as pe >>> # Given a dictinoary as the following >>> data = { ... "1": [1, 2, 3, 4, 5, 6, 7, 8], ... "3": [1.25, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8], ... "5": [2, 3, 4, 5, 6, 7, 8, 9], ... "7": [1, '',] ... } >>> sheet = pe.get_sheet(adict=data) >>> sheet.row[1] [1, 1.25, 2, 1] >>> sheet.format(str) >>> sheet.row[1] ['1', '1.25', '2', '1'] >>> sheet.format(int) >>> sheet.row[1] [1, 1, 2, 1]