Tabular
Tabular[data]
creates a tabular object from rectangular data representing a list of rows.
Tabular[data,{key1,key2,…}]
sets keyi as the name of column i of the tabular object.
Details and Options
- Tabular is also known as data frame, table and structured data.
- Tabular is typically used for data where each column can be thought of as a variable and each row as a measurement. Typically, only a window of data is displayed.
- Each column has an element type, such as number, string, date or expression. Data entries can be missing.
- Possible forms of data include:
-
{row1,row2,…} matrix as a list of rows » {assoc1,assoc2,…} list of associations with common keys » SparseArray[…],QuantityArray[…],… special matrix representations » Dataset[…] rectangular dataset » - Use ToTabular to convert more types of expressions to Tabular as well as have detailed control over how the conversion is done.
- Tabular[data,schm] sets or modifies the schema of the tabular data, where schm is given as a TabularSchema object or an association <"prop1"val1,… >.
- SQL-backed tabular objects can be created using the following forms for spec in Tabular[spec]:
-
RelationalDatabase[…] relational database object containing a single table RelationalDatabase[…]"table" select a table from a relational database <"RelationalDatabase"RelationalDatabase[…],"Query""table" > extended specification of a table from a database - Tabular can recognize and operate with missing or exceptional values, such as Missing[], Null, Infinity, etc.
- The data elements can be extracted using Part, Select, etc.
- Tabular can be converted to other forms using FromTabular or Normal.
- Tabular works with transformation functions such as TransformColumns and AggregateRows.
Examples
open allclose allBasic Examples (5)
Scope (28)
Creating Tabular Objects (12)
Construct a Tabular object from a list of rows:
Construct a Tabular object from a matrix, specifying column names:
Construct a Tabular object from a list of associations:
Create a Tabular object from a list of associations with ExtendedKey:
Create a Tabular object from a QuantityArray:
Tabular object from column-oriented list data requires Transpose:
Use ToTabular instead:
Convert a Dataset into a Tabular object:
Converting to Tabular will flatten the dataset structure:
Use Import of "CSV" to automatically get a Tabular object:
Import a "TSV" file:
Construct a Tabular object of numbers, specifying the type of the elements of each column:
Mix columns of different types:
Tabular stores them by default as strings:
Convert to "CategoricalOrdered" type, internally storing a single copy of each size value:
Show a Tabular object whose rows correspond to entities and whose columns are entity properties:
Extracting Data (9)
Extract a single element Tabular object:
Extract a column using a column key:
Extract a row of a Tabular object with a key column:
Extract a row of a Tabular object with several key columns:
Extract multiple columns from a Tabular object:
Extract two columns and reverse their order:
Extract multiple columns by column keys:
Use conditions to select rows:
Extract all the rows with "SepalLength" greater than or equal to 6:
Cleaning Data (4)
Take a Tabular object of country data:
Sort by decreasing values of population:
Applications (2)
Use a Tabular object to display column data with separate column headings:
Use the array data and "ColumnHeadings" property to create a Tabular object:
Plot petal length as a function of sepal length:
Compute mean values of flower measurements depending on the species type:
Information about "DuneBooks" in Tabular form:
Properties & Relations (3)
Use TabularQ to test if a Tabular object is valid:
The columns of a Tabular object are given as TabularColumn objects:
The rows of a Tabular object are given as TabularRow objects:
Possible Issues (3)
Tabular input data must be at least two dimensional:
Raggedness in the second level is not accepted:
Arrays must be rectangular in the first two levels:
A Tabular object cannot have repeated column keys, which makes Part eliminate duplicates:
Map the Part extraction to generate duplicate columns:
Create a Tabular object without column keys or with different column keys:
Text
Wolfram Research (2025), Tabular, Wolfram Language function, https://reference.wolfram.com/language/ref/Tabular.html.
CMS
Wolfram Language. 2025. "Tabular." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Tabular.html.
APA
Wolfram Language. (2025). Tabular. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Tabular.html