Table() |
6 |
Create an empty table, usually to extend with data |
Table().read_table(filename) |
6 |
Create a table from a data file |
tbl.with_columns(name, values) tbl.with_columns(n1, v1, n2, v2,...) |
6 |
A table with an additional or replaced column or columns. name is a string for the name of a column, values is an array |
tbl.column(column_name_or_index) |
6 |
The values of a column (an array) |
tbl.num_rows |
6 |
Compute the number of rows in a table |
tbl.num_columns |
6 |
Compute the number of columns in a table |
tbl.labels |
6 |
Lists the column labels in a table |
tbl.select(col1, col2, ...) |
6 |
Create a copy of a table with only some of the columns. Each column is the column name or index. |
tbl.drop(col1, col2, ...) |
6 |
Create a copy of a table without some of the columns. Each column is the column name or index. |
tbl.relabel(old_label, new_label) |
6 |
Modifies the existing table in place, changing the column heading in the first argument to the second |
tbl.relabeled(old_label, new_label) |
6 |
Returns a new table with the column heading in the first argument changed to the second |
tbl.sort(column_name_or_index) |
6.1 |
Create a copy of a table sorted by the values in a column. Defaults to ascending order unless “descending = True” is included |
tbl.where(column, predicate) |
6.2 |
Create a copy of a table with only the rows that match some predicate See Table.where predicates below |
tbl.take(row_indices) |
6.2 |
A table with only the rows at the given indices. row_indices is an array of indices. |
tbl.scatter(x_column, y_column) |
7 |
Draws a scatter plot consisting of one point for each row of the table. Note that x_column and y_column must be strings specifying column names. |
tbl.plot(x_column, y_column) |
7 |
Draw a line graph consisting of one point for each row of the table. |
tbl.barh(categories), tbl.barh(categories, values) |
7.1 |
Displays a bar chart with bars for each category in a column, with height proportional to the corresponding frequency. values argument unnecessary if table has only a column of categories and a column of values. |
tbl.hist(column, unit, bins) |
7.2 |
Generates a histogram of the numerical values in a column. unit and bins are optional arguments, used to label the axes and group the values into intervals (bins), respectively. Bins have the form [a, b). |
tbl.apply(function, column) |
8.1 |
Returns an array of values resulting from applying a function to each item in a column. |
tbl.group(column_or_columns, func) |
8.2 |
Group rows by unique values or combinations of values in a column(s). Multiple columns must be entered in array or list form. Other values aggregated by count (default) or optional argument func. |
tbl.pivot(col1, col2, vals, collect), tbl.pivot(col1, col2) |
8.3 |
A pivot table where each unique value in col1 has its own column and each unique value in col2 has its own row. Count or aggregate values from a third column, collect with some function. Default vals and collect return counts in cells. |
tblA.join(colA, tblB, colB), tblA.join(colA, tblB) |
8.4 |
Generate a table with the columns of tblA and tblB, containing rows for all values of a column that appear in both tables. Default colB is colA. colA and colB must be strings specifying column names. |
tbl.sample(n), tbl.sample(n, with_replacement) |
10 |
A new table where n rows are randomly sampled from the original table. Default is with replacement. For sampling without replacement, use argument with_replacement=False. For a non-uniform sample, provide a third argument weights=distribution where distribution is an array or list containing the probability of each row. |
sample_proportions(sample_size, model_proportions) |
11.1 |
Sample_size should be an integer, model_proportions an array of probabilities that sum up to 1. The function samples sample_size objects from the distribution specified by model_proportions. It returns an array with the same size as model_proportions. Each item in the array corresponds to the proportion of times it was sampled out of the sample_size times. |