tabel module

transpose

tabel.transpose(datastruct)

Transpose rows and columns.

Convenience function. Usually DB connectors return data as a list of records, Tabel takes and internally stores data as a list of columns (column store). This function will transpose the list of records into a list of columns without a priori assuming anything about the datatype of each individual element.

Parameters:datastruct (list) – list or tuple containing lists or tuples with the data for each row.
Returns:transposed datastruct, list containing lists with the data for each column.
tabel.T(datastruct)

Convenience alias for tabel.transpose.

read_tabel

tabel.read_tabel(filename, fmt=u'auto', header=True)

Read data from disk

Read data from disk and return a Tabel object.

Parameters:
  • filename (str) – filename sring, including path and extension.
  • fmt (str) – format specifier, supports: ‘csv’, ‘npz’, ‘gz’.
  • header (bool) – whether to expect a header (True) or not (False) or try to sniff (None), only used for csv and gz
Returns:

Tabel object containing the data.

first

tabel.first(array)

Get the first element when doing a tabel.Tabel.group_by.

Arguments :
array (numpy ndarray) :
numpy 1D array containing the subset of elements
Returns :
The first element of ar
Examples :
See Tabel.group_by for examples