pyexcel.Sheet

class pyexcel.Sheet(sheet=None, name='pyexcel', name_columns_by_row=-1, name_rows_by_column=-1, colnames=None, rownames=None, transpose_before=False, transpose_after=False)[source]

Two dimensional data container for filtering, formatting and iteration

Sheet is a container for a two dimensional array, where individual cell can be any Python types. Other than numbers, value of thsee types: string, date, time and boolean can be mixed in the array. This differs from Numpy’s matrix where each cell are of the same number type.

In order to prepare two dimensional data for your computation, formatting functions help convert array cells to required types. Formatting can be applied not only to the whole sheet but also to selected rows or columns. Custom conversion function can be passed to these formatting functions. For example, to remove extra spaces surrounding the content of a cell, a custom function is required.

Filtering functions are used to reduce the information contained in the array.

__init__(sheet=None, name='pyexcel', name_columns_by_row=-1, name_rows_by_column=-1, colnames=None, rownames=None, transpose_before=False, transpose_after=False)

Constructor

Parameters:
  • sheet – two dimensional array
  • name – this becomes the sheet name.
  • name_columns_by_row – use a row to name all columns
  • name_rows_by_column – use a column to name all rows
  • colnames – use an external list of strings to name the columns
  • rownames – use an external list of strings to name the rows

Methods

Attributes

colnames Return column names
column Column representation.
row Row representation.
rownames Return row names