Add Table Column

Append a column to a table.

Arguments

Argument Type Default value Description
tabletable to modify
nameNonename of new column
valuesNonerow values (or single scalar value for all rows)
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

Append rows to a table.

Arguments

Argument Type Default value Description
tabletable to modify
rowvalue for new row
indexNoneindex name for new row
param table:table to modify
param row:value for new row
param index:index name for new row

Clear Table

Clear table in-place, but keep columns.

Arguments

Argument Type Default value Description
tabletable to clear
param table:table to clear

Copy Table

Copy table object.

Arguments

Argument Type Default value Description
tabletable to copy
param table:table to copy

Create Table

Create Table object from data.

Arguments

Argument Type Default value Description
dataNonesource data for table
trimFalseremove all empty rows from the end of the worksheet, default False
columnsNonenames of columns (optional)
indexNonenames of rows (optional)

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
param columns:names of columns (optional)
param index:names of rows (optional)

Export Table

Convert table object to standard Python containers.

Arguments

Argument Type Default value Description
tabletable to convert to dict
with_indexFalseinclude index in values
as_listTrueexport data as list instead of dict
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

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

Arguments

Argument Type Default value Description
tabletable to filter
param table:table to filter

Filter Table By Column

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

Arguments

Argument Type Default value Description
tabletable to filter
columncolumn to filter with
operatorfiltering operator, e.g. >, <, ==, contains
valuevalue to compare column to (using operator)
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)

Find Table Rows

Find a row in the table by a given column value.

Arguments

Argument Type Default value Description
tableTable to find from
columnname of column to search
valuevalue to match for
as_listFalsereturn list instead of dictionary
param table:Table to find from
param column:name of column to search
param value:value to match for
param as_list:return list instead of dictionary

Get Table Cell

Get a cell value from table.

Arguments

Argument Type Default value Description
tabletable to read from
rowrow of cell
columncolumn of cell
param table:table to read from
param row:row of cell
param column:column of cell

Get Table Column

Get all column values from table.

Arguments

Argument Type Default value Description
tabletable to read
columncolumn to read
as_listFalsereturn list instead of dictionary
param table:table to read
param column:column to read
param as_list:return list instead of dictionary

Get Table Dimensions

Return table dimensions, as (rows, columns).

Arguments

Argument Type Default value Description
tabletable to inspect
param table:table to inspect

Get Table Row

Get a single row from table.

Arguments

Argument Type Default value Description
tabletable to read
index
as_listFalsereturn list instead of dictionary
param table:table to read
param row:row to read
param as_list:return list instead of dictionary

Get Table Slice

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

Arguments

Argument Type Default value Description
tabletable to read from
startNoneend index (inclusive)
endNone
param table:table to read from
param start:start index (inclusive)
param start:end index (inclusive)

Group Table By Column

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

Arguments

Argument Type Default value Description
tabletable to use for grouping
columncolumn which is used as grouping criteria
param table:table to use for grouping
param column:column which is used as grouping criteria

Merge Tables

Create a union of two tables and their contents.

Arguments

Argument Type Default value Description
*tables
indexNoneColumn name to use as index for merge
param tables:Tables to merge
param index:Column name to use as index for merge

By default rows from all tables are appended one after the other. Optionally a column name can be given with index, which is used to merge rows together.

Examples

For instance, a name column could be used to identify unique rows and the merge operation should overwrite values instead of appending multiple copies of the same name.

Name Price
Egg 10.0
Cheese 15.0
Ham 20.0
Name Stock
Egg 12.0
Cheese 99.0
Ham 0.0
*** Tasks ***
${products}=    Merge tables    ${prices}    ${stock}    index=Name
FOR    ${product}    IN    @{products}
    Log many
    ...    Product: ${product}[Name]
    ...    Price: ${product}[Price]
    ...    Stock: ${product}[Stock]
END

Pop Table Column

Remove column from table and return it.

Arguments

Argument Type Default value Description
tabletable to modify
columnNonecolumn to remove
as_listFalsereturn list instead of dictionary
param table:table to modify
param column:column to remove
param as_list:return list instead of dictionary

Pop Table Row

Remove row from table and return it.

Arguments

Argument Type Default value Description
tabletable to modify
indexNonerow index, pops first row if none given
as_listFalsereturn list instead of dictionary
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

Read a CSV file as a table.

Arguments

Argument Type Default value Description
pathpath to CSV file
headerNoneCSV file includes header
columnsNonenames of columns in resulting table
dialectNoneformat of CSV file
delimitersNonestring of possible delimiters
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

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.

Rename Table Columns

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

Arguments

Argument Type Default value Description
tabletable to modify
columnslist of new column names
strictFalseif True, raises ValueError if column lengths do not match

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

Set Column As Index

Set existing column as index for rows.

Arguments

Argument Type Default value Description
tabletable to modify
columnNonecolumn to convert to index
param table:table to modify
param column:column to convert to index

Set Row As Column Names

Set existing row as names for columns.

Arguments

Argument Type Default value Description
tabletable to modify
indexrow to use as column names
param table:table to modify
param index:row to use as column names

Set Table Cell

Set a cell value in the table.

Arguments

Argument Type Default value Description
tabletable to modify to
rowrow of cell
columncolumn of cell
valuevalue to set
param table:table to modify to
param row:row of cell
param column:column of cell
param value:value to set

Set Table Column

Assign values to entire column in the table.

Arguments

Argument Type Default value Description
tabletable to modify
columncolumn to modify
valuesvalue(s) to set
param table:table to modify
param column:column to modify
param values:value(s) to set

Set Table Row

Assign values to a row in the table.

Arguments

Argument Type Default value Description
tabletable to modify
rowrow to modify
valuesvalue(s) to set
param table:table to modify
param row:row to modify
param values:value(s) to set

Sort Table By Column

Sort table in-place according to column.

Arguments

Argument Type Default value Description
tabletable to sort
columncolumn to sort with
ascendingFalsetable sort order
param table:table to sort
param column:column to sort with
param ascending:
 table sort order

Table Head

Return first count rows from table.

Arguments

Argument Type Default value Description
tabletable to read from
count5number of lines to read
as_listFalsereturn list instead of Table
param table:table to read from
param count:number of lines to read
param as_list:return list instead of Table

Table Tail

Return last count rows from table.

Arguments

Argument Type Default value Description
tabletable to read from
count5number of lines to read
as_listFalsereturn list instead of 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

Remove all extraneous whitespace from column names.

Arguments

Argument Type Default value Description
table

Trim Empty Rows

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

Arguments

Argument Type Default value Description
tabletable to filter

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

param table:table to filter

Write Table To Csv

Write a table as a CSV file.

Arguments

Argument Type Default value Description
tabletable to write
pathpath to write to
headerTruewrite columns as header to CSV file
dialectexcelthe format of output CSV
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

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