RowKey

RowKey[{key1,key2,}]

represents a key that can be used to extract the row of a Tabular object for which the key columns have values keyi.

Details

  • RowKey is typically used to access rows of a Tabular object.
  • For a given Tabular object, the list of keyi in RowKey[{key1,key2,}] must uniquely specify each row.
  • RowKey[key] is understood as RowKey[{key}].
  • RowKey[][tab] is equivalent to tab[RowKey[]] for a Tabular object tab.

Examples

open allclose all

Basic Examples  (1)

Create a Tabular object with three columns:

Set one of them to be a key column, to allow indexing by that column:

Extract the row containing "b" in the key column:

Alternatively, use RowKey[] as a function:

Scope  (3)

Create a Tabular object with a key column:

Extract the row containing "a" in the key column:

The List wrapper is not needed when there is a single key column:

Use RowKey[] as a function acting on a Tabular object:

Take a Tabular object of populations of the G7 countries:

Set two columns as key columns:

Use RowKey to extract a value for a given column:

Applications  (1)

Take tabular data of fatal collisions for each state:

There are no key columns specified:

Reorder the columns and set the "state" column as key column:

Extract the rows for US Midwest states:

Properties & Relations  (4)

Take a Tabular object with a key column:

Row extraction can be performed with RowKey:

Key wrappers can also be used to extract a tabular row:

Keys of a Tabular object returns a list of RowKey expressions if key columns are specified:

For multiple key columns:

RowKey[{key1,key2,}] allows indexing rows by the values of multiple key columns:

ExtendedKey[key1,key2,] allows specifying columns by multiple values:

RowKey can contain keys corresponding to columns specified by ExtendedKey objects:

Wolfram Research (2025), RowKey, Wolfram Language function, https://reference.wolfram.com/language/ref/RowKey.html.

Text

Wolfram Research (2025), RowKey, Wolfram Language function, https://reference.wolfram.com/language/ref/RowKey.html.

CMS

Wolfram Language. 2025. "RowKey." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RowKey.html.

APA

Wolfram Language. (2025). RowKey. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RowKey.html

BibTeX

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

BibLaTeX

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