ColumnKeyExistsQ
ColumnKeyExistsQ[data,key]
returns True if the specified key exists in the tabular data, and False otherwise.
ColumnKeyExistsQ[key]
represents an operator form of ColumnKeyExistsQ that can be applied to an expression.
Details
- Possible forms of data in ColumnKeyExistsQ[data,key] include:
-
Tabular[…] tabular data as a list of typed columns Dataset[…] general hierarchical data {assoc1,assoc2,…} list of associations with common keys - ColumnKeyExistsQ[key][data] is equivalent to ColumnKeyExistsQ[data,key].
Examples
open allclose allBasic Examples (1)
Check whether a column key exists in a Tabular object:
Scope (7)
Data Forms (5)
Check the presence of a column key in a Tabular object:
For a Tabular object without column keys, ColumnKeyExistsQ always returns False:
Check the presence of a key in any of the associations of a list of them:
ColumnKeyExistsQ effectively assumes Missing[…] values, as Tabular would do:
Check the presence of a column key in a Dataset object:
Use ColumnKeyExistsQ as an operator form:
Key Forms (2)
Check whether a given column key is present in a Tabular object:
The key in ColumnKeyExistsQ[tab,key] can be wrapped in Key or ExtendedKey:
Take a Tabular object with extended column keys:
Check whether a given extended key is present:
Extended keys can be addressed by their last argument if they are unique:
Properties & Relations (2)
ColumnKeyExistsQ[tab,key] is equivalent to MemberQ[ColumnKeys[tab],key]:
For a list assocs of associations, ColumnKeyExistsQ[assocs,key] is equivalent to using KeyExistsQ in the associations:
ColumnKeyExistsQ returns True if the key exists in any of the associations:
Text
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.
APA
Wolfram Language. (2025). ColumnKeyExistsQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColumnKeyExistsQ.html