Add Table Column

Arguments

  • table
  • name=None
  • values=None

Append a column to a table.

param table:table to modify
param name:name of new column
param values:row values (or single scalar value for all rows)

Add Table Row

Arguments

  • table
  • row
  • index=None

Append rows to a table.

param table:table to modify
param row:value for new row
param index:index name for new row

Clear Table

Arguments

  • table

Clear table in-place, but keep columns.

param table:table to clear

Copy Table

Arguments

  • table

Copy table object.

param table:table to copy

Create Table

Arguments

  • data=None
  • trim=False

Create Table object from data.

Data can be a combination of various iterable containers, e.g. list of lists, list of dicts, dict of lists.

param data:source data for table
param trim:remove all empty rows from the end of the worksheet, default False

Export Table

Arguments

  • table
  • with_index=False
  • as_list=True

Convert table object to standard Python containers.

param table:table to convert to dict
param with_index:
 include index in values
param as_list:export data as list instead of dict

Filter Empty Rows

Arguments

  • table

Remove all rows from the table which have only None values.

param table:table to filter

Filter Table By Column

Arguments

  • table
  • column
  • operator
  • value

Return all rows where the column values match the given condition.

param table:table to filter
param column:column to filter with
param operator:filtering operator, e.g. >, <, ==, contains
param value:value to compare column to (using operator)

Get Table Cell

Arguments

  • table
  • row
  • column

Get a cell value from table.

param table:table to read from
param row:row of cell
param column:column of cell

Get Table Column

Arguments

  • table
  • column
  • as_list=False

Get all column values from table.

param table:table to read
param column:column to read
param as_list:return list instead of dictionary

Get Table Dimensions

Arguments

  • table

Return table dimensions, as (rows, columns).

param table:table to inspect

Get Table Row

Arguments

  • table
  • index
  • as_list=False

Get a single row from table.

param table:table to read
param row:row to read
param as_list:return list instead of dictionary

Get Table Slice

Arguments

  • table
  • start=None
  • end=None

Return a new Table from a subset of given Table rows.

param table:table to read from
param start:start index (inclusive)
param start:end index (inclusive)

Group Table By Column

Arguments

  • table
  • column

Group table by column and return a list of grouped Tables.

param table:table to use for grouping
param column:column which is used as grouping criteria

Pop Table Column

Arguments

  • table
  • column=None
  • as_list=False

Remove column from table and return it.

param table:table to modify
param column:column to remove
param as_list:return list instead of dictionary

Pop Table Row

Arguments

  • table
  • index=None
  • as_list=False

Remove row from table and return it.

param table:table to modify
param index:row index, pops first row if none given
param as_list:return list instead of dictionary

Read Table From Csv

Arguments

  • path
  • header=None
  • columns=None
  • dialect=None
  • delimiters=None

Read a CSV file as a table.

By default attempts to deduce the CSV format and headers from a sample of the input file. If it's unable to determine the format automatically, the dialect and header will have to be defined manually.

Valid dialect values are excel, excel-tab, and unix, and header is boolean argument (True/False). Optionally a set of valid delimiters can be given as a string.

The columns argument can be used to override the names of columns in the resulting table. The amount of columns must match the input data.

param path:path to CSV file
param header:CSV file includes header
param columns:names of columns in resulting table
param dialect:format of CSV file
param delimiters:
 string of possible delimiters

Rename Table Columns

Arguments

  • table
  • columns
  • strict=False

Renames columns in the Table with given values. Columns with name as None will be use previous value.

param table:table to modify
param columns:list of new column names
param strict:if True, raises ValueError if column lengths do not match

Requires Table

Arguments

  • obj

Set Column As Index

Arguments

  • table
  • column=None

Set existing column as index for rows.

param table:table to modify
param column:column to convert to index

Set Table Cell

Arguments

  • table
  • row
  • column
  • value

Set a cell value in the table.

param table:table to modify to
param row:row of cell
param column:column of cell
param value:value to set

Set Table Column

Arguments

  • table
  • column
  • values

Assign values to entire column in the table.

param table:table to modify
param column:column to modify
param values:value(s) to set

Set Table Row

Arguments

  • table
  • row
  • values

Assign values to a row in the table.

param table:table to modify
param row:row to modify
param values:value(s) to set

Sort Table By Column

Arguments

  • table
  • column
  • ascending=False

Sort table in-place according to column.

param table:table to sort
param column:column to sort with
param ascending:
 table sort order

Table Head

Arguments

  • table
  • count=5
  • as_list=False

Return first count rows from table.

param table:table to read from
param count:number of lines to read
param as_list:return list instead of Table

Table Tail

Arguments

  • table
  • count=5
  • as_list=False

Return last count rows from table.

param table:table to read from
param count:number of lines to read
param as_list:return list instead of Table

Trim Column Names

Arguments

  • table

Remove all extraneous whitespace from column names.

Trim Empty Rows

Arguments

  • table

Remove all rows from the end of the table which have only None values.

param table:table to filter

Write Table To Csv

Arguments

  • table
  • path
  • header=True
  • dialect=excel

Write a table as a CSV file.

Valid dialect values are excel, excel-tab, and unix.

param path:path to write to
param table:table to write
param header:write columns as header to CSV file
param dialect:the format of output CSV