FromTabular[tab,"form"]
converts a Tabular object tab to an object given by "form".
FromTabular[tab,"form",assoc]
uses directives from the association assoc to give details of the conversion.
FromTabular
FromTabular[tab,"form"]
converts a Tabular object tab to an object given by "form".
FromTabular[tab,"form",assoc]
uses directives from the association assoc to give details of the conversion.
Details
- FromTabular is typically used to provide control over how Tabular objects are converted to other data objects.
- In FromTabular[tab,form,…], the structure specification "form" can include:
-
"Columns" collection of TabularColumn objects "Rows" list of rows "Matrix" matrix of values "Dataset" multilevel data "TimeSeries" TimeSeries object "EventSeries" EventSeries object "TemporalData" TemporalData object - The association assoc can contain specific information on how to convert tabular to the different forms.
- When converting to TimeSeries or TemporalData, possible keys in assoc include:
-
"TimeColumn" Automatic column to use for times (first column with time-related key will be used; if it fails, then the first column of Tabular will be used, falling back on Automatic time specification) "ValueColumns" Automatic columns to use for values (default all except time column)
Examples
open all close allBasic Examples (1)
Scope (18)
Rows and Columns (5)
Get rows from a Tabular object without column keys:
tab = Tabular[{{1, 2, 3}, {4, 5, 6}}]FromTabular[tab, "Rows"]Get rows from a Tabular object with column keys:
tab = Tabular[{{1, 2, 3}, {4, 5, 6}}, {"a", "b", "c"}]Returns list of associations with column keys:
FromTabular[tab, "Rows"]Values[%]FromTabular[tab, "Matrix"]Get columns from a Tabular object without column keys:
tab = Tabular[{{1, 2, 3}, {4, 5, 6}}]Return a list of TabularColumn objects:
FromTabular[tab, "Columns"]Normal /@ %Obtain the list directly from Tabular:
tab["ColumnList"]Get columns from a Tabular object with column keys:
tab = Tabular[{{1, 2, 3}, {4, 5, 6}}, {"a", "b", "c"}]Return an association with column keys:
FromTabular[tab, "Columns"]Normal /@ %tab["ColumnList"]Take a Tabular object with list entries:
tab = Tabular[RandomInteger[10, {4, 3, 2}]]Both "Rows" and "Columns" forms affect only the two top levels of the Tabular object:
FromTabular[tab, "Rows"]//MatrixForm[#, TableDepth -> 2]&FromTabular[tab, "Columns"]//Normal//MatrixForm[#, TableDepth -> 2]&Dataset (4)
Get a Dataset expression from a Tabular object without column keys:
tab = Tabular[{{1, 2, 3}, {4, 5, 6}}]FromTabular[tab, "Dataset"]Obtain the same result by using Dataset:
Dataset[tab]Get a Dataset expression from a Tabular object with column keys:
tab = Tabular[{{1, 2, 3}, {4, 5, 6}}, {"a", "b", "c"}]The column keys are preserved:
FromTabular[tab, "Dataset"]Take a Tabular object with a key column:
tab = Tabular[{{1, 2, 3}, {4, 5, 6}}, <|"ColumnKeys" -> {"A", "b", "c"}, "KeyColumns" -> {"A"}|>]The key column is converted into the row keys of the dataset:
FromTabular[tab, "Dataset"]Normalize to see the key column entries as association keys:
%//NormalTake a Tabular object with two key columns:
tab = Tabular[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, <|"ColumnKeys" -> {"A", "B", "c"}, "KeyColumns" -> {"A", "B"}|>]The key columns "A" and "B" are converted into keys of nested levels of the dataset:
FromTabular[tab, "Dataset"]Normalize to see the key columns entries as association keys:
%//NormalTimeSeries (3)
Convert a Tabular object without column keys into TimeSeries:
tab = ToTabular[{{11, 22, 33}, {.1, .3, .2}, {"dog", "cat", "fox"}, {Yesterday, Today, Tomorrow}}, "Columns"]FromTabular[tab, "TimeSeries"]The time stamps are taken to be the first column:
Normal[%]Specify which columns to use for times and values:
FromTabular[tab, "TimeSeries", <|"TimeColumn" -> 4, "ValueColumns" -> {3, 1}|>]Normal[%]Convert a Tabular object with column keys into TimeSeries:
tab = ToTabular[{"val1" -> {1, 2, 3}, "val2" -> {.1, .3, .2}, "val3" -> {"dog", "cat", "fox"}, "dates" -> {Yesterday, Today, Tomorrow}}, "Columns"]FromTabular[tab, "TimeSeries"]The default time stamps are taken from the column with key "dates":
Normal[%]Specify which columns to use for times and values using column names:
FromTabular[tab, "TimeSeries", <|"TimeColumn" -> "dates", "ValueColumns" -> {"val2", "val3", "val1"}|>]Normal[%]Converting a Tabular object with column keys preserves the keys as component keys:
tab = ToTabular[{"a" -> {1, 2, 3}, "b" -> {.1, .3, .2}, "c" -> {"dog", "cat", "fox"}, "d" -> {Yesterday, Today, Tomorrow}}, "Columns"]FromTabular[tab, "TimeSeries"]%//ColumnKeysSpecify new names for components:
FromTabular[tab, "TimeSeries", <|"ComponentNames" -> {"c1", "c2", "c3"}|>]%//ColumnKeysEventSeries (3)
Convert a Tabular object without column keys into EventSeries:
tab = Tabular[{{DateObject[{2026, 3, 8}, "Day"], 11, 0.1, "dog"}, {DateObject[{2026, 3, 9}, "Day"], 22, 0.3, "cat"}, {DateObject[{2026, 3, 9}, "Day"], 33, 0.2, "fox"}}, {"a", "b", "c", "d"}]FromTabular[tab, "EventSeries"]Dates in the first column are used as timestamps for the event series:
%//TabularConvert a Tabular object without a dates column into EventSeries:
tab = Tabular[{{"a", True}, {"b", False}, {"c", True}}, {"char", "bool"}]FromTabular[tab, "EventSeries"]With no column that can be used as timestamps, integers starting from 0 will be used by default:
%//TabularSpecify which column should be used as EventSeries timestamps:
tab = ToTabular[{"instant" -> Now + Quantity[{1.5, 2.7, 9.2}, "Days"], "day" -> Today + Quantity[{0, 7, 20}, "Days"], "val" -> {1, 2, 3}}, "Columns"]FromTabular[tab, "EventSeries", <|"TimeColumn" -> "day"|>]%//TabularTemporalData (3)
Convert a Tabular object without column keys into TemporalData:
ToTabular[{{1, 2, 3}, {.1, .3, .2}, {"dog", "cat", "fox"}, {Yesterday, Today, Tomorrow}}, "Columns"]FromTabular[%, "TemporalData"]Each column becomes a path, and the default time stamps are positive integers:
Normal[%]Convert a Tabular object with column keys into TemporalData:
ToTabular[{"a" -> {1, 2, 3}, "b" -> {.1, .3, .2}, "c" -> {"dog", "cat", "fox"}, "d" -> {Yesterday, Today, Tomorrow}}, "Columns"]Specify which columns to use for times and values:
FromTabular[%, "TemporalData", <|"TimeColumn" -> 4, "ValueColumns" -> {"c", "a"}|>]Information[%]Convert a Tabular object with ExtendedKey into TemporalData:
tab = Tabular[...]ColumnKeys[tab]FromTabular[tab, "TemporalData", <|"TimeColumn" -> "Time"|>]Each column has been converted to a path:
%["PathNames"]Applications (2)
Sales Data (1)
data = Tabular[{...}]Use PivotToColumns to separate sales for each city:
PivotToColumns[data, "City" -> "Sales"]Create a TemporalData with "Date" used as the "TimeColumn":
td = FromTabular[%, "TemporalData", <|"TimeColumn" -> "Date"|>]The column headers are stored in "MetaInformation":
td["MetaInformation"]Visualize the sales time series:
DateListPlot[td, PlotLegends -> Last /@ td["PathNames"]]Financial Time Series (1)
Take a Tabular of financial time series:
data = Tabular[{...}];GraphicsRow@{data, DateListPlot[data -> {"Date", "Value"}]}Use FromTabular to create TimeSeries:
ts = FromTabular[data, "TimeSeries", <|"TimeColumn" -> "Date"|>]TimeSeriesModelFit[ts, "ARIMA"]Normal[%]Properties & Relations (1)
FromTabular[tab,"Rows"] and FromTabular[tab,"Columns"] effectively return the transpose of each other:
tab = Tabular[{{1, "a", True}, {2, "b", False}}]FromTabular[tab, "Rows"]FromTabular[tab, "Columns"]//NormalTranspose[%] === %%Possible Issues (2)
FromTabular[...,"Columns"] returns an Association when columns have specified keys:
tab = Tabular[Transpose@{{1, 2, 3}, {"cat", "fox", "dog"}}, {"a", "b"}]FromTabular[tab, "Columns"]Get the list of columns directly from the Tabular object:
tab["ColumnList"]For a Tabular without column keys, FromTabular[...,"Columns"] returns a list:
Tabular[Transpose@{{1, 2, 3}, {"cat", "fox", "dog"}}]FromTabular[%, "Columns"]For "TemporalData" form, FromTabular creates multiple paths from columns but admits only one set of time stamps:
tab = ToTabular[{"a" -> {1, 2, 3}, "b" -> {.1, .3, .2}, "c" -> {"dog", "cat", "fox"}, "d" -> {Yesterday, Today, Tomorrow}}, "Columns"]Only the first column will be accepted:
FromTabular[tab, "TemporalData", <|"TimeColumn" -> {"b", "d"}|>]%["Paths"]FromTabular[tab, "TemporalData", <|"TimeColumn" -> {"d", "b"}|>]%["DatePaths"]History
Text
Wolfram Research (2025), FromTabular, Wolfram Language function, https://reference.wolfram.com/language/ref/FromTabular.html.
CMS
Wolfram Language. 2025. "FromTabular." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FromTabular.html.
APA
Wolfram Language. (2025). FromTabular. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FromTabular.html
BibTeX
@misc{reference.wolfram_2026_fromtabular, author="Wolfram Research", title="{FromTabular}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/FromTabular.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_fromtabular, organization={Wolfram Research}, title={FromTabular}, year={2025}, url={https://reference.wolfram.com/language/ref/FromTabular.html}, note=[Accessed: 13-June-2026]}