Tables (datascience.tables
)¶
Summary of methods for Table. Click a method to see its documentation.
One note about reading the method signatures for this page: each method is listed with its arguments. However, optional arguments are specified in brackets. That is, a method that’s documented like
Table.foo
(first_arg, second_arg[, some_other_arg, fourth_arg])
means that the Table.foo
method must be called with first_arg and second_arg
and optionally some_other_arg and fourth_arg. That means the following are valid
ways to call Table.foo
:
some_table.foo(1, 2)
some_table.foo(1, 2, 'hello')
some_table.foo(1, 2, 'hello', 'world')
some_table.foo(1, 2, some_other_arg='hello')
But these are not valid:
some_table.foo(1) # Missing arg
some_table.foo(1, 2[, 'hi']) # SyntaxError
some_table.foo(1, 2[, 'hello', 'world']) # SyntaxError
If that syntax is confusing, you can click the method name itself to get to the details page for that method. That page will have a more straightforward syntax.
Creation
|
Create an empty table with column labels. |
|
Create a table from a sequence of records (dicts with fixed keys). |
|
Create a table from a mapping of column labels to column values. |
|
Read a table from a file or web address. |
|
Convert a Pandas DataFrame into a Table. |
|
Convert a structured NumPy array into a Table. |
Extension (does not modify original table)
|
Return a new table with an additional or replaced column. |
|
Return a table with additional or replaced columns. |
|
Return a table with an additional row. |
|
Return a table with additional rows. |
|
Return a new table with |
Accessing values
Number of columns. |
|
Return a tuple of columns, each with the values in that column. |
|
|
Return the values of a column as an array. |
Computes the number of rows in a table |
|
Return a view of all rows. |
|
|
Return a row. |
Return a tuple of column labels. |
|
|
Return the zeroth item in a column. |
|
Return the last item in a column. |
Return data in self as a numpy array. |
|
|
Return the index of a column by looking up its label. |
|
Apply |
Mutation (modifies table in place)
|
Set the pretty print format of a column(s) and/or convert its values. |
|
Move a column to be the first column. |
|
Move a column to be the last column. |
|
Append a row or all rows of a table in place. |
|
Appends a column to the table or replaces a column. |
|
Changes the label(s) of column(s) specified by |
|
Removes a row or multiple rows of a table in place (row number is 0 indexed). |
Transformation (creates a new table)
|
Return a copy of a table. |
|
Return a table with only the columns in |
|
Return a Table with only columns other than selected label or labels. |
Return a new Table with selected rows taken by index. |
|
Return a new Table without a sequence of rows excluded by number. |
|
|
Returns a new table with specified column moved to the specified column index. |
|
Return a new |
|
Return a Table of rows sorted according to the values in a column. |
|
Group rows by unique values in a column; count or aggregate others. |
|
Group rows by multiple columns, count or aggregate others. |
|
Generate a table with a column for each unique value in |
|
Takes k original columns and returns two columns, with col. |
|
Creates a new table with the columns of self and other, containing rows for all values of a column that appear in both tables. |
|
Compute statistics for each column and place them in a table. |
Return a new table with one row containing the pth percentile for each column. |
|
|
Return a new table where k rows are randomly sampled from the original table. |
Return a new table where all the rows are randomly shuffled from the original table. |
|
|
Return a new table with the same number of rows and a new column. |
|
Return a tuple of two tables where the first table contains |
|
Group values by bin and compute counts per bin by column. |
|
Form a table with columns formed by the unique tuples in pivot_columns containing counts per bin of the values associated with each tuple in the value_column. |
|
Return a new table with |
|
Return a table with an additional row. |
|
Return a table with additional rows. |
|
Return a new table with an additional or replaced column. |
|
Return a table with additional or replaced columns. |
Exporting / Displaying
|
Display the table. |
|
Format table as text |
|
Format table as HTML |
|
Return a dict keyed by values in a column that contains lists of |
Convert the table to a structured NumPy array. |
|
Convert the table to a Pandas DataFrame. |
|
|
Creates a CSV file with the provided filename. |
Visualizations
|
Plot line charts for the table. |
|
Plot bar charts for the table. |
|
Plot a bar chart for the table. |
|
Plot horizontal bar charts for the table. |
|
Plot a horizontal bar chart for the table. |
|
Draw histograms of each category in a column. |
|
Plots one histogram for each column in columns. |
|
Plots one count-based histogram for each column in columns. |
|
Creates scatterplots, optionally adding a line of best fit. |
|
Convenience wrapper for |
|
Plots a boxplot for the table. |
Redirects |
|
Turns off redirection of |