keys
utilityReturns array indices, object keys, or DataFrame column names
Syntax
keys(value) Parameters
value (array | object | DataFrame) The value to extract keys from
Returns
array Array of keys, indices, or column names
Examples
Get object keys
Input:
{name: "Alice", age: 30} | keys Output:
["name", "age"] Get DataFrame column names
Input:
. | keys Output:
["id", "name", "email"] The keys() function extracts the keys from objects, indices from arrays, or column names from DataFrames.
Usage
Use keys() to discover the structure of data, iterate over object properties, or get column names from DataFrames.