WOLFRAM

RowKey
RowKey

New in 14.2[Experimental]

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)Summary of the most common use cases

Create a Tabular object with three columns:

Out[1]=1

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

Out[2]=2

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

Out[3]=3
Out[4]=4

Alternatively, use RowKey[] as a function:

Out[5]=5

Scope  (3)Survey of the scope of standard use cases

Create a Tabular object with a key column:

Out[1]=1

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

Out[2]=2
Out[3]=3

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

Out[4]=4

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

Out[1]=1

Take a Tabular object of populations of the G7 countries:

Set two columns as key columns:

Out[2]=2

Use RowKey to extract a value for a given column:

Out[3]=3

Applications  (1)Sample problems that can be solved with this function

Take tabular data of fatal collisions for each state:

Out[1]=1
Out[2]=2

There are no key columns specified:

Out[3]=3

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

Out[4]=4
Out[5]=5
Out[6]=6

Extract the rows for US Midwest states:

Out[7]=7
Out[8]=8

Properties & Relations  (4)Properties of the function, and connections to other functions

Take a Tabular object with a key column:

Out[1]=1

Row extraction can be performed with RowKey:

Out[2]=2

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

Out[3]=3

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

Out[1]=1
Out[2]=2

For multiple key columns:

Out[3]=3
Out[4]=4

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

Out[1]=1
Out[2]=2

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

Out[3]=3
Out[4]=4

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

Out[2]=2
Out[3]=3
Wolfram Research (2025), RowKey, Wolfram Language function, https://reference.wolfram.com/language/ref/RowKey.html.
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.

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.

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

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

BibTeX

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

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

BibLaTeX

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

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