WOLFRAM

ColumnKeyExistsQ
ColumnKeyExistsQ

New in 14.2[Experimental]

ColumnKeyExistsQ[data,key]

returns True if the specified key exists in the tabular data, and False otherwise.

represents an operator form of ColumnKeyExistsQ that can be applied to an expression.

Details

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Check whether a column key exists in a Tabular object:

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

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

Data Forms  (5)

Check the presence of a column key in a Tabular object:

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

For a Tabular object without column keys, ColumnKeyExistsQ always returns False:

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

Check the presence of a key in any of the associations of a list of them:

Out[2]=2
Out[3]=3
Out[4]=4
Out[5]=5

ColumnKeyExistsQ effectively assumes Missing[] values, as Tabular would do:

Out[6]=6

Check the presence of a column key in a Dataset object:

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

Use ColumnKeyExistsQ as an operator form:

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

Key Forms  (2)

Check whether a given column key is present in a Tabular object:

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

The key in ColumnKeyExistsQ[tab,key] can be wrapped in Key or ExtendedKey:

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

Take a Tabular object with extended column keys:

Out[1]=1

Check whether a given extended key is present:

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

Extended keys can be addressed by their last argument if they are unique:

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

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

ColumnKeyExistsQ[tab,key] is equivalent to MemberQ[ColumnKeys[tab],key]:

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

For a list assocs of associations, ColumnKeyExistsQ[assocs,key] is equivalent to using KeyExistsQ in the associations:

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

ColumnKeyExistsQ returns True if the key exists in any of the associations:

Out[4]=4
Out[5]=5
Wolfram Research (2025), ColumnKeyExistsQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnKeyExistsQ.html.
Wolfram Research (2025), ColumnKeyExistsQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnKeyExistsQ.html.

Text

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

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

CMS

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

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

APA

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

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

BibTeX

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

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

BibLaTeX

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

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