is an option of TimeSeries and EventSeries that specifies the keys of the components.
ComponentKeys
is an option of TimeSeries and EventSeries that specifies the keys of the components.
Details
- ComponentKeys is typically used to name the data components of a time or event series.
- Possible settings for ComponentKeys include:
-
Automatic select component keys automatically from data » None return a simple time or event series » {com1,com2,…} return a time or event series with components comi » - TimeSeries[vals,times,keys] is equivalent to TimeSeries[vals,times,ComponentKeyskeys].
Examples
open all close allBasic Examples (2)
Construct a time series with component keys "a" and "b":
TimeSeries[{{.1, "cat"}, {.2, "dog"}, {.3, "fox"}}, {{Yesterday, Today, Tomorrow}}, ComponentKeys -> {"a", "b"}]Show the data using conversion to Tabular:
Tabular[%]Create an event series from a list of pairs of dates for full moon and new moon:
EventSeries[{{DateObject[{2026, 1, 3, 4, 2, 54.5329}, "Instant", "Gregorian", -6.], DateObject[{2026, 1, 18, 13, 51, 58.9335}, "Instant", "Gregorian", -6.]}, {DateObject[{2026, 2, 1, 16, 9, 14.7054}, "Instant", "Gregorian", -6.], DateObject[{2026, 2, 17, 6, 1, 9.07329}, "Instant", "Gregorian", -6.]}, {DateObject[{2026, 3, 3, 5, 37, 53.7335}, "Instant", "Gregorian", -6.], DateObject[{2026, 3, 18, 19, 23, 28.7273}, "Instant", "Gregorian", -6.]}}, {DateObject[{2026, 1}], Automatic, "Month"}, ComponentKeys -> {"FullMoon", "NewMoon"}]Show the data using conversion to Tabular:
Tabular[%]Scope (6)
TimeSeries[{{.1, "cat"}, {.2, "dog"}, {.3, "fox"}}, {{Yesterday, Today, Tomorrow}}, ComponentKeys -> {"a", "b"}]Show the data using conversion to Tabular:
Tabular[%]Component keys are added automatically when the given list is incomplete:
TimeSeries[{{.1, "cat"}, {.2, "dog"}, {.3, "fox"}}, {{Yesterday, Today, Tomorrow}}, ComponentKeys -> {"number"}]ColumnKeys[%]Generate all component keys by giving {}:
TimeSeries[{{.1, "cat"}, {.2, "dog"}, {.3, "fox"}}, {{Yesterday, Today, Tomorrow}}, ComponentKeys -> {}]ColumnKeys[%]The Automatic setting of ComponentKeys preserves the input keys:
Tabular[{{.1, "cat"}, {.2, "dog"}, {.3, "fox"}}, {"K1", "K2"}]tab = Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["K1" -> Association["ElementType" -> "Real64"],
"K2" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{0.1, 0.2, 0.3}, {}, None},
"ElementType" -> "Real64"]], TabularColumn[Association[
"Data" -> {{3, {0, 3, 6, 9}, "catdogfox"}, {}, None}, "ElementType" -> "String"]]}}]]]];TimeSeries[tab, {{Yesterday, Today, Tomorrow}}, ComponentKeys -> Automatic]Tabular[%]When component keys are given, they override the input keys:
tab = Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["K1" -> Association["ElementType" -> "Real64"],
"K2" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{0.1, 0.2, 0.3}, {}, None},
"ElementType" -> "Real64"]], TabularColumn[Association[
"Data" -> {{3, {0, 3, 6, 9}, "catdogfox"}, {}, None}, "ElementType" -> "String"]]}}]]]];TimeSeries[tab, {{Yesterday, Today, Tomorrow}}, ComponentKeys -> {"a", "b"}]Tabular[%]With component keys set to None, the output time series is simple, without explicit components:
tab = Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["K1" -> Association["ElementType" -> "Real64"],
"K2" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{0.1, 0.2, 0.3}, {}, None},
"ElementType" -> "Real64"]], TabularColumn[Association[
"Data" -> {{3, {0, 3, 6, 9}, "catdogfox"}, {}, None}, "ElementType" -> "String"]]}}]]]];TimeSeries[tab, {{Yesterday, Today, Tomorrow}}, ComponentKeys -> None]Tabular[%]When there are no input keys, the Automatic setting will preserve the simple component input:
TimeSeries[{{.1, "cat"}, {.2, "dog"}, {.3, "fox"}}, {{Yesterday, Today, Tomorrow}}, ComponentKeys -> Automatic]Tabular[%]Properties & Relations (2)
The component keys can be provided as a third argument or as an option:
vals = {{.1, "cat"}, {.2, "dog"}, {.3, "fox"}};
times = {Yesterday, Today, Tomorrow};
keys = {"number", "animal"};TimeSeries[vals, {times}, keys]TimeSeries[vals, {times}, ComponentKeys -> keys] === %The component keys given as an argument will override those given by the option:
TimeSeries[{{.1, "cat"}, {.2, "dog"}, {.3, "fox"}}, {{Yesterday, Today, Tomorrow}}, {"A", "B"}, ComponentKeys -> {"a", "b"}]Tabular[%]See Also
History
Text
Wolfram Research (2026), ComponentKeys, Wolfram Language function, https://reference.wolfram.com/language/ref/ComponentKeys.html.
CMS
Wolfram Language. 2026. "ComponentKeys." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ComponentKeys.html.
APA
Wolfram Language. (2026). ComponentKeys. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ComponentKeys.html
BibTeX
@misc{reference.wolfram_2026_componentkeys, author="Wolfram Research", title="{ComponentKeys}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/ComponentKeys.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_componentkeys, organization={Wolfram Research}, title={ComponentKeys}, year={2026}, url={https://reference.wolfram.com/language/ref/ComponentKeys.html}, note=[Accessed: 12-June-2026]}