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.

更多信息

  • 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
    "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""RowNumber"column to use for times (default integer indices)
    "ValueColumns"Automaticcolumns to use for values (default all except time column)

范例

打开所有单元关闭所有单元

基本范例  (1)

Convert from a Tabular object to row-oriented data:

Convert to columns instead:

Get a Dataset:

Scope  (15)

Rows and Columns  (5)

Get rows from a Tabular object without column keys:

Returns list of rows:

Get rows from a Tabular object with column keys:

Returns list of associations with column keys:

Obtain values directly:

Get columns from a Tabular object without column keys:

Return a list of TabularColumn objects:

Normalize them:

Obtain the list directly from Tabular:

Get columns from a Tabular object with column keys:

Return an association with column keys:

Normalize the columns:

Obtain the list of columns:

Take a Tabular object with list entries:

Both "Rows" and "Columns" forms affect only the two top levels of the Tabular object:

Dataset  (4)

Get a Dataset expression from a Tabular object without column keys:

Obtain the same result by using Dataset:

Get a Dataset expression from a Tabular object with column keys:

The column keys are preserved:

Take a Tabular object with a key column:

The key column is converted into the row keys of the dataset:

Normalize to see the key column entries as association keys:

Take a Tabular object with two key columns:

The key columns "A" and "B" are converted into keys of nested levels of the dataset:

Normalize to see the key columns entries as association keys:

TimeSeries  (3)

Convert a Tabular object without column keys into TimeSeries:

The default time stamps are positive integers:

Specify which columns to use for times and values:

Convert a Tabular object with column keys into TimeSeries:

The default time stamps are positive integers:

Specify which columns to use for times and values using column names:

Converting a Tabular object with column keys preserves the keys as component names:

Specify new names for components:

TemporalData  (3)

Convert a Tabular object without column keys into TemporalData:

Each column becomes a path, and the default time stamps are positive integers:

Convert a Tabular object with column keys into TemporalData:

Specify which columns to use for times and values:

Convert a Tabular object with ExtendedKey into TemporalData:

Applications  (2)

Sales Data  (1)

Get retail data:

Use PivotToColumns to separate sales for each city:

Create a TemporalData with "Date" used as the "TimeColumn":

The column headers are stored in "MetaInformation":

Visualize the sales time series:

Financial Time Series  (1)

Take a Tabular of financial time series:

Show the data and its plot:

Use FromTabular to create TimeSeries:

Fit a time series model:

Properties & Relations  (1)

FromTabular[tab,"Rows"] and FromTabular[tab,"Columns"] effectively return the transpose of each other:

Possible Issues  (2)

FromTabular[...,"Columns"] returns an Association when columns have specified keys:

Get the list of columns directly from the Tabular object:

For a Tabular without column keys, FromTabular[...,"Columns"] returns a list:

For "TemporalData" form, FromTabular creates multiple paths from columns but admits only one set of time stamps:

Only the first column will be accepted:

Change order:

Wolfram Research (2025),FromTabular,Wolfram 语言函数,https://reference.wolfram.com/language/ref/FromTabular.html.

文本

Wolfram Research (2025),FromTabular,Wolfram 语言函数,https://reference.wolfram.com/language/ref/FromTabular.html.

CMS

Wolfram 语言. 2025. "FromTabular." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/FromTabular.html.

APA

Wolfram 语言. (2025). FromTabular. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/FromTabular.html 年

BibTeX

@misc{reference.wolfram_2025_fromtabular, author="Wolfram Research", title="{FromTabular}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/FromTabular.html}", note=[Accessed: 15-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_fromtabular, organization={Wolfram Research}, title={FromTabular}, year={2025}, url={https://reference.wolfram.com/language/ref/FromTabular.html}, note=[Accessed: 15-January-2025 ]}